public interface

SshAuthenticationHandler

com.atlassian.bitbucket.auth.SshAuthenticationHandler

Class Overview

Implementations should be stateless and thread-safe, as a single instance will be used to service all authentication requests.

Summary

Public Methods
@Deprecated @Nullable ApplicationUser authenticate(SshAuthenticationContext authenticationContext)
This method is deprecated. in 5.5 for removal in 6.0. Use performAuthentication(SshAuthenticationContext) instead.
@Nullable AuthenticationResult performAuthentication(SshAuthenticationContext authenticationContext)
Invoked by the system when authentication is attempted over SSH.

Public Methods

@Deprecated @Nullable public ApplicationUser authenticate (SshAuthenticationContext authenticationContext)

This method is deprecated.
in 5.5 for removal in 6.0. Use performAuthentication(SshAuthenticationContext) instead.

Invoked by the system when authentication is attempted over SSH. Implementations must

  • return the ApplicationUser instance of the authenticated user 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 returning null, other handlers will be attempted.
  • throw an AuthenticationException if the provided authentication details are invalid (e.g. invalid username / public key, etc.). In this case, no other handlers will be attempted.
All registered handlers will be invoked in weight order until a handler successfully authenticates the user, or throws an AuthenticationException.

Parameters
authenticationContext the authentication context that provides username, public key, remote address, etc.
Returns
  • the authenticated user on success, null when the handler opts out of authentication.
Throws
when authentication fails.

@Nullable public AuthenticationResult performAuthentication (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 returning null, other handlers will be attempted.
  • throw an AuthenticationException if the provided authentication details are invalid (e.g. invalid username / public key, etc.). In this case, no other handlers will be attempted.
All registered handlers will be invoked in weight order until a handler successfully authenticates the user, or throws an AuthenticationException.

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, or null if the handler opted out
Throws
when authentication fails.