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 void
authenticate(C credentials, AuthenticateRequest authenticationRequest)
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
-
MockHttpAuthentication
public MockHttpAuthentication(MockAuthentication authentication, java.lang.Class<C> credentialsType)
Instantiate.- Parameters:
authentication
-MockAuthentication
.credentialsType
- Credentials type.
-
-
Method Detail
-
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 authenticationRequest)
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
.authenticationRequest
-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
.
-
-