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 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 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:
      com.atlassian.bitbucket.auth.AuthenticationException - when authentication fails.
      Since:
      5.5