Class DefaultKeyboardInteractiveAuthenticator

    • Field Detail

      • KB_INTERACTIVE_NAME_PROP

        public static final java.lang.String KB_INTERACTIVE_NAME_PROP
        See Also:
        Constant Field Values
      • DEFAULT_KB_INTERACTIVE_NAME

        public static final java.lang.String DEFAULT_KB_INTERACTIVE_NAME
        See Also:
        Constant Field Values
      • KB_INTERACTIVE_INSTRUCTION_PROP

        public static final java.lang.String KB_INTERACTIVE_INSTRUCTION_PROP
        See Also:
        Constant Field Values
      • DEFAULT_KB_INTERACTIVE_INSTRUCTION

        public static final java.lang.String DEFAULT_KB_INTERACTIVE_INSTRUCTION
        See Also:
        Constant Field Values
      • KB_INTERACTIVE_LANG_PROP

        public static final java.lang.String KB_INTERACTIVE_LANG_PROP
        See Also:
        Constant Field Values
      • DEFAULT_KB_INTERACTIVE_LANG

        public static final java.lang.String DEFAULT_KB_INTERACTIVE_LANG
        See Also:
        Constant Field Values
      • KB_INTERACTIVE_PROMPT_PROP

        public static final java.lang.String KB_INTERACTIVE_PROMPT_PROP
        See Also:
        Constant Field Values
      • DEFAULT_KB_INTERACTIVE_PROMPT

        public static final java.lang.String DEFAULT_KB_INTERACTIVE_PROMPT
        See Also:
        Constant Field Values
      • KB_INTERACTIVE_ECHO_PROMPT_PROP

        public static final java.lang.String KB_INTERACTIVE_ECHO_PROMPT_PROP
        See Also:
        Constant Field Values
      • DEFAULT_KB_INTERACTIVE_ECHO_PROMPT

        public static final boolean DEFAULT_KB_INTERACTIVE_ECHO_PROMPT
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultKeyboardInteractiveAuthenticator

        public DefaultKeyboardInteractiveAuthenticator()
    • Method Detail

      • generateChallenge

        public InteractiveChallenge generateChallenge​(ServerSession session,
                                                      java.lang.String username,
                                                      java.lang.String lang,
                                                      java.lang.String subMethods)
                                               throws java.lang.Exception
        Description copied from interface: KeyboardInteractiveAuthenticator
        Generates the interactive "challenge" to send to the client
        Specified by:
        generateChallenge in interface KeyboardInteractiveAuthenticator
        Parameters:
        session - The ServerSession through which the request was received
        username - The username
        lang - The language tag
        subMethods - Sub-methods hints sent by the client
        Returns:
        The InteractiveChallenge - if null then authentication attempt via "keyboard-interactive" method is rejected
        Throws:
        java.lang.Exception - If unable to generate the challenge
      • authenticate

        public boolean authenticate​(ServerSession session,
                                    java.lang.String username,
                                    java.util.List<java.lang.String> responses)
                             throws java.lang.Exception
        Description copied from interface: KeyboardInteractiveAuthenticator
        Called to authenticate the response to the challenge(s) sent previously
        Specified by:
        authenticate in interface KeyboardInteractiveAuthenticator
        Parameters:
        session - The ServerSession through which the response was received
        username - The username
        responses - The received responses - Note: it is up to the authenticator to make sure that the number of responses matches the number of prompts sent in the initial challenge. The order of the responses matches the order of the prompts sent to the client
        Returns:
        true if responses have been validated
        Throws:
        java.lang.Exception - if bad responses and server should terminate the connection
      • getInteractionName

        protected java.lang.String getInteractionName​(ServerSession session)
      • getInteractionInstruction

        protected java.lang.String getInteractionInstruction​(ServerSession session)
      • getInteractionLanguage

        protected java.lang.String getInteractionLanguage​(ServerSession session)
      • getInteractionPrompt

        protected java.lang.String getInteractionPrompt​(ServerSession session)
      • isInteractionPromptEchoEnabled

        protected boolean isInteractionPromptEchoEnabled​(ServerSession session)