Interface KeyboardInteractiveAuthenticator
-
- All Known Implementing Classes:
DefaultKeyboardInteractiveAuthenticator
public interface KeyboardInteractiveAuthenticatorProvides pluggable authentication using the "keyboard-interactive" method as specified by RFC-4256?- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static KeyboardInteractiveAuthenticatorNONEAn authenticator that rejects any attempt to use it
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanauthenticate(ServerSession session, String username, List<String> responses)Called to authenticate the response to the challenge(s) sent previouslyInteractiveChallengegenerateChallenge(ServerSession session, String username, String lang, String subMethods)Generates the interactive "challenge" to send to the client
-
-
-
Field Detail
-
NONE
static final KeyboardInteractiveAuthenticator NONE
An authenticator that rejects any attempt to use it
-
-
Method Detail
-
generateChallenge
InteractiveChallenge generateChallenge(ServerSession session, String username, String lang, String subMethods) throws Exception
Generates the interactive "challenge" to send to the client- Parameters:
session- TheServerSessionthrough which the request was receivedusername- The usernamelang- The language tagsubMethods- Sub-methods hints sent by the client- Returns:
- The
InteractiveChallenge- ifnullthen authentication attempt via "keyboard-interactive" method is rejected - Throws:
Exception- If unable to generate the challenge
-
authenticate
boolean authenticate(ServerSession session, String username, List<String> responses) throws Exception
Called to authenticate the response to the challenge(s) sent previously- Parameters:
session- TheServerSessionthrough which the response was receivedusername- The usernameresponses- 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:
trueif responses have been validated- Throws:
Exception- if bad responses and server should terminate the connection
-
-