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 Object
implements HttpAuthentication<C>, AccessControlListener<HttpAccessControl>
HttpAuthentication implementation.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionHttpAuthenticationImpl(AuthenticationContext<? extends HttpAccessControl, C> authenticationContext, Class<C> credentialsType) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessControlChange(HttpAccessControl accessControl, Throwable escalation) Notified of a change to access control.voidauthenticate(C credentials, AuthenticateRequest authenticateRequest) Triggers to undertake authentication.Obtains theHttpAccessControl.Obtains the type of credentials.booleanIndicates if authenticated.voidlogout(LogoutRequest logoutRequest) Undertakes logging out.
-
Constructor Details
-
HttpAuthenticationImpl
public HttpAuthenticationImpl(AuthenticationContext<? extends HttpAccessControl, C> authenticationContext, Class<C> credentialsType) Instantiate.- Parameters:
authenticationContext-AuthenticationContext.credentialsType- Type of credentials.
-
-
Method Details
-
accessControlChange
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
Description 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
Description copied from interface:HttpAuthenticationObtains the type of credentials.- Specified by:
getCredentialsTypein interfaceHttpAuthentication<C>- Returns:
- Type of credentials.
-
authenticate
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
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
Description copied from interface:HttpAuthenticationUndertakes logging out.- Specified by:
logoutin interfaceHttpAuthentication<C>- Parameters:
logoutRequest-LogoutRequest.
-