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>
HttpAuthentication
implementation.- 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 void
accessControlChange(HttpAccessControl accessControl, java.lang.Throwable escalation)
Notified of a change to access control.void
authenticate(C credentials, AuthenticateRequest authenticateRequest)
Triggers to undertake authentication.HttpAccessControl
getAccessControl()
Obtains theHttpAccessControl
.java.lang.Class<C>
getCredentialsType()
Obtains the type of credentials.boolean
isAuthenticated()
Indicates if authenticated.void
logout(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:AccessControlListener
Notified of a change to access control.- Specified by:
accessControlChange
in interfaceAccessControlListener<C>
- Parameters:
accessControl
- Access control. May benull
if- logging out
- failure in authenticating
escalation
- PossibleEscalation
. Will benull
if successfully obtain access control or logout.
-
isAuthenticated
public boolean isAuthenticated() throws HttpException
Description copied from interface:HttpAuthentication
Indicates if authenticated.- Specified by:
isAuthenticated
in interfaceHttpAuthentication<C>
- Returns:
true
if 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:HttpAuthentication
Obtains the type of credentials.- Specified by:
getCredentialsType
in interfaceHttpAuthentication<C>
- Returns:
- Type of credentials.
-
authenticate
public void authenticate(C credentials, AuthenticateRequest authenticateRequest)
Description copied from interface:HttpAuthentication
Triggers to undertake authentication.- Specified by:
authenticate
in interfaceHttpAuthentication<C>
- Parameters:
credentials
- Credentials. May benull
if no credentials are required, or they are pulled from theHttpRequest
.authenticateRequest
-AuthenticateRequest
.
-
getAccessControl
public HttpAccessControl getAccessControl() throws AuthenticationRequiredException, HttpException
Description copied from interface:HttpAuthentication
Obtains theHttpAccessControl
.- Specified by:
getAccessControl
in 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:HttpAuthentication
Undertakes logging out.- Specified by:
logout
in interfaceHttpAuthentication<C>
- Parameters:
logoutRequest
-LogoutRequest
.
-
-