Top Description Methods
org.apache.sshd.server.auth.password

public Interface PasswordAuthenticator

Known Direct Implementers
org.apache.sshd.server.auth.password.StaticPasswordAuthenticator, org.apache.sshd.server.jaas.JaasPasswordAuthenticator
Annotations
@FunctionalInterface
Imports
org.apache.sshd.server.auth.AsyncAuthException, org.apache.sshd.server.session.ServerSession

Used to authenticate users based on a password.
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true indicating if authentication succeeded
authenticate
(String
The username credential
username
,
String
The provided password
password
,
ServerSession
The ServerSession attempting the authentication
session
)

Check the validity of a password.

public default boolean

Returns:

true if password change accepted
handleClientPasswordChangeRequest
(ServerSession
The ServerSession attempting the authentication
session
,
String
The username credential
username
,
String
The old password
oldPassword
,
String
The new password
newPassword
)

Invoked when the client sends a SSH_MSG_USERAUTH_REQUEST indicating a password change.

Method Detail

authenticateback to summary
public boolean authenticate(String username, String password, ServerSession session) throws PasswordChangeRequiredException, AsyncAuthException

Check the validity of a password.

Parameters
username:String

The username credential

password:String

The provided password

session:ServerSession

The ServerSession attempting the authentication

Returns:boolean

true indicating if authentication succeeded

Exceptions
PasswordChangeRequiredException:
If the password is expired or not strong enough to suit the server's policy
AsyncAuthException:
If the authentication is performed asynchronously
handleClientPasswordChangeRequestback to summary
public 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. 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.

Parameters
session:ServerSession

The ServerSession attempting the authentication

username:String

The username credential

oldPassword:String

The old password

newPassword:String

The new password

Returns:boolean

true if password change accepted