Package com.atlassian.bitbucket.auth
Interface SshAuthenticationHandler
public interface SshAuthenticationHandler
Implementations should be stateless and thread-safe, as a single instance will be used to service all authentication
requests.
-
Method Summary
Modifier and TypeMethodDescriptionperformAuthentication
(SshAuthenticationContext authenticationContext) Invoked by the system when authentication is attempted over SSH.
-
Method Details
-
performAuthentication
@Nullable AuthenticationResult performAuthentication(@Nonnull SshAuthenticationContext authenticationContext) Invoked by the system when authentication is attempted over SSH. Implementations must-
return an
AuthenticationResult
if the user is authenticated successfully -
return
null
if the handler does not know how to authenticate the user from the request (for instance when a public key cannot be found in the system). By returningnull
, otherhandlers
will be attempted. -
throw an
AuthenticationException
if the provided authentication details are invalid (e.g. invalid username / public key, etc.). In this case, no otherhandlers
will be attempted.
handlers
will be invoked inweight order
until a handler successfully authenticates theuser
, or throws anAuthenticationException
.- Parameters:
authenticationContext
- the authentication context that provides username, public key, remote address, etc- Returns:
- an
AuthenticationResult
if the handler was able to authenticate a user based on the request, ornull
if the handler opted out - Throws:
com.atlassian.bitbucket.auth.AuthenticationException
- when authentication fails.- Since:
- 5.5
-
return an
-