Class HttpAuthenticationImpl<C>
- java.lang.Object
-
- net.officefloor.web.security.scheme.HttpAuthenticationImpl<C>
-
- All Implemented Interfaces:
HttpAuthentication<C>,AccessControlListener<HttpAccessControl>
public class HttpAuthenticationImpl<C> extends java.lang.Object implements HttpAuthentication<C>, AccessControlListener<HttpAccessControl>
HttpAuthenticationimplementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description HttpAuthenticationImpl(AuthenticationContext<? extends HttpAccessControl,C> authenticationContext, java.lang.Class<C> credentialsType)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccessControlChange(HttpAccessControl accessControl, java.lang.Throwable escalation)Notified of a change to access control.voidauthenticate(C credentials, AuthenticateRequest authenticateRequest)Triggers to undertake authentication.HttpAccessControlgetAccessControl()Obtains theHttpAccessControl.java.lang.Class<C>getCredentialsType()Obtains the type of credentials.booleanisAuthenticated()Indicates if authenticated.voidlogout(LogoutRequest logoutRequest)Undertakes logging out.
-
-
-
Constructor Detail
-
HttpAuthenticationImpl
public HttpAuthenticationImpl(AuthenticationContext<? extends HttpAccessControl,C> authenticationContext, java.lang.Class<C> credentialsType)
Instantiate.- Parameters:
authenticationContext-AuthenticationContext.credentialsType- Type of credentials.
-
-
Method Detail
-
accessControlChange
public void accessControlChange(HttpAccessControl accessControl, java.lang.Throwable escalation)
Description copied from interface:AccessControlListenerNotified of a change to access control.- Specified by:
accessControlChangein interfaceAccessControlListener<C>- Parameters:
accessControl- Access control. May benullif- logging out
- failure in authenticating
escalation- PossibleEscalation. Will benullif successfully obtain access control or logout.
-
isAuthenticated
public boolean isAuthenticated() throws HttpExceptionDescription copied from interface:HttpAuthenticationIndicates if authenticated.- Specified by:
isAuthenticatedin interfaceHttpAuthentication<C>- Returns:
trueif authenticated.- Throws:
HttpException- If authentication has been attempted but there were failures in undertaking authentication.
-
getCredentialsType
public java.lang.Class<C> getCredentialsType()
Description copied from interface:HttpAuthenticationObtains the type of credentials.- Specified by:
getCredentialsTypein interfaceHttpAuthentication<C>- Returns:
- Type of credentials.
-
authenticate
public void authenticate(C credentials, AuthenticateRequest authenticateRequest)
Description copied from interface:HttpAuthenticationTriggers to undertake authentication.- Specified by:
authenticatein interfaceHttpAuthentication<C>- Parameters:
credentials- Credentials. May benullif no credentials are required, or they are pulled from theHttpRequest.authenticateRequest-AuthenticateRequest.
-
getAccessControl
public HttpAccessControl getAccessControl() throws AuthenticationRequiredException, HttpException
Description copied from interface:HttpAuthenticationObtains theHttpAccessControl.- Specified by:
getAccessControlin interfaceHttpAuthentication<C>- Returns:
HttpAccessControl.- Throws:
AuthenticationRequiredException- If not authenticated.HttpException- If failure occurred in authentication.
-
logout
public void logout(LogoutRequest logoutRequest)
Description copied from interface:HttpAuthenticationUndertakes logging out.- Specified by:
logoutin interfaceHttpAuthentication<C>- Parameters:
logoutRequest-LogoutRequest.
-
-