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
AuthenticationResultif the user is authenticated successfully -
return
nullif 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, otherhandlerswill be attempted. -
throw an
AuthenticationExceptionif the provided authentication details are invalid (e.g. invalid username / public key, etc.). In this case, no otherhandlerswill be attempted.
handlerswill be invoked inweight orderuntil a handler successfully authenticates theuser, or throws anAuthenticationException.- Parameters:
authenticationContext- the authentication context that provides username, public key, remote address, etc- Returns:
- an
AuthenticationResultif the handler was able to authenticate a user based on the request, ornullif the handler opted out - Throws:
com.atlassian.bitbucket.auth.AuthenticationException- when authentication fails.- Since:
- 5.5
-
return an
-