Package net.officefloor.web.security
Interface HttpAuthentication<C>
-
- All Known Implementing Classes:
AnonymousHttpSecuritySource,HttpAuthenticationImpl,MockHttpAuthentication
public interface HttpAuthentication<C>Dependency interface allowing the application to check if the HTTP client is authenticated.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
isAuthenticated
boolean isAuthenticated() throws HttpExceptionIndicates if authenticated.- Returns:
trueif authenticated.- Throws:
HttpException- If authentication has been attempted but there were failures in undertaking authentication.
-
getCredentialsType
java.lang.Class<C> getCredentialsType()
Obtains the type of credentials.- Returns:
- Type of credentials.
-
authenticate
void authenticate(C credentials, AuthenticateRequest authenticateRequest)
Triggers to undertake authentication.- Parameters:
credentials- Credentials. May benullif no credentials are required, or they are pulled from theHttpRequest.authenticateRequest-AuthenticateRequest.
-
getAccessControl
HttpAccessControl getAccessControl() throws AuthenticationRequiredException, HttpException
Obtains theHttpAccessControl.- Returns:
HttpAccessControl.- Throws:
AuthenticationRequiredException- If not authenticated.HttpException- If failure occurred in authentication.
-
logout
void logout(LogoutRequest logoutRequest)
Undertakes logging out.- Parameters:
logoutRequest-LogoutRequest.
-
-