Package com.atlassian.bitbucket.auth
Interface HttpAuthenticationHandler
public interface HttpAuthenticationHandler
Implementations may also implement 
HttpLogoutHandler, in which case they'll get a callback when the user
 logs out.
 Implementations should be stateless and thread-safe, as a single instance will be used to service all authentication requests.
- 
Method SummaryModifier and TypeMethodDescriptionperformAuthentication(HttpAuthenticationContext authenticationContext) Invoked by the system when authentication is attempted over HTTP.voidvalidateAuthentication(HttpAuthenticationContext authenticationContext) Invoked by the system on requests that have an authenticated user.
- 
Method Details- 
validateAuthenticationInvoked by the system on requests that have an authenticated user. Implementations that need to check whether an external (SSO) session is still valid should implement that logic here.This method is called for every incoming request after the user initially authenticated. Implementors should make the implementation of this method as lightweight as possible. - Parameters:
- authenticationContext- the authentication context that provides the authenticated user, request details, etc.
- Throws:
- com.atlassian.bitbucket.auth.AuthenticationException- if the current authentication is no longer valid and the user must re-authenticate.
 
- 
performAuthentication@Nullable AuthenticationResult performAuthentication(@Nonnull HttpAuthenticationContext authenticationContext) Invoked by the system when authentication is attempted over HTTP. 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 an expected SSO cookie is not present). By returningnull, otherhandlerswill be attempted.
- 
         throw an AuthenticationExceptionif the provided authentication details are invalid (e.g. invalid username / password, cookie, etc.). In this case, no otherhandlerswill be attempted.
 handlerswill be invoked inweight orderuntil a handler returns aAuthenticationResult, or throws anAuthenticationException.- Parameters:
- authenticationContext- the authentication context that provides username, password, request details, 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- if the handler is able to authenticate the request, but the credentials supplied were not valid or could not be validated
- Since:
- 5.5
 
- 
         return an 
 
-