@FunctionalInterface public interface PasswordAuthenticator
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(String username,
String password,
ServerSession session)
Check the validity of a password.
|
default boolean |
handleClientPasswordChangeRequest(ServerSession session,
String username,
String oldPassword,
String newPassword)
Invoked when the client sends a
SSH_MSG_USERAUTH_REQUEST indicating a password change. |
boolean authenticate(String username, String password, ServerSession session) throws PasswordChangeRequiredException, AsyncAuthException
username
- The username credentialpassword
- The provided passwordsession
- The ServerSession
attempting the authenticationtrue
indicating if authentication succeededPasswordChangeRequiredException
- If the password is expired or not strong enough to suit the server's
policyAsyncAuthException
- If the authentication is performed asynchronouslydefault boolean handleClientPasswordChangeRequest(ServerSession session, String username, String oldPassword, String newPassword)
SSH_MSG_USERAUTH_REQUEST
indicating a password change. This can happen if
the authenticate
method threw PasswordChangeRequiredException
thus telling the client that it
needs to provide a new password. Throws UnsupportedOperationException
by default.session
- The ServerSession
attempting the authenticationusername
- The username credentialoldPassword
- The old passwordnewPassword
- The new passwordtrue
if password change acceptedCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.