Class MockHttpAuthentication<C>
java.lang.Object
net.officefloor.web.security.scheme.MockHttpAuthentication<C>
- All Implemented Interfaces:
HttpAuthentication<C>
Mock
HttpAuthentication.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionMockHttpAuthentication(MockAuthentication authentication, Class<C> credentialsType) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(C credentials, AuthenticateRequest authenticationRequest) Triggers to undertake authentication.Obtains theHttpAccessControl.Obtains the type of credentials.booleanIndicates if authenticated.voidlogout(LogoutRequest logoutRequest) Undertakes logging out.
-
Constructor Details
-
MockHttpAuthentication
Instantiate.- Parameters:
authentication-MockAuthentication.credentialsType- Credentials type.
-
-
Method Details
-
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.authenticationRequest-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.
-