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 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.
-
-
-
Method Detail
-
isAuthenticated
boolean isAuthenticated() throws HttpException
Indicates if authenticated.- Returns:
true
if 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 benull
if 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
.
-
-