Class MockHttpAuthentication<C>
- java.lang.Object
-
- net.officefloor.web.security.scheme.MockHttpAuthentication<C>
-
- All Implemented Interfaces:
HttpAuthentication<C>
public class MockHttpAuthentication<C> extends java.lang.Object implements HttpAuthentication<C>
MockHttpAuthentication.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MockHttpAuthentication(MockAuthentication authentication, java.lang.Class<C> credentialsType)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate(C credentials, AuthenticateRequest authenticationRequest)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.
-
-
-
Constructor Detail
-
MockHttpAuthentication
public MockHttpAuthentication(MockAuthentication authentication, java.lang.Class<C> credentialsType)
Instantiate.- Parameters:
authentication-MockAuthentication.credentialsType- Credentials type.
-
-
Method Detail
-
isAuthenticated
public boolean isAuthenticated() throws HttpExceptionDescription 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
public java.lang.Class<C> getCredentialsType()
Description copied from interface:HttpAuthenticationObtains the type of credentials.- Specified by:
getCredentialsTypein interfaceHttpAuthentication<C>- Returns:
- Type of credentials.
-
authenticate
public void authenticate(C credentials, AuthenticateRequest authenticationRequest)
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
public HttpAccessControl getAccessControl() throws AuthenticationRequiredException, HttpException
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
public void logout(LogoutRequest logoutRequest)
Description copied from interface:HttpAuthenticationUndertakes logging out.- Specified by:
logoutin interfaceHttpAuthentication<C>- Parameters:
logoutRequest-LogoutRequest.
-
-