Class MockFlowHttpSecuritySource
- java.lang.Object
-
- net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
-
- net.officefloor.web.security.scheme.MockFlowHttpSecuritySource
-
- All Implemented Interfaces:
HttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
,HttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
@TestSource public class MockFlowHttpSecuritySource extends AbstractHttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows> implements HttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
MockHttpSecuritySource
that challenges with a HTML form.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MockFlowHttpSecuritySource.Flows
Flow
keys.-
Nested classes/interfaces inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
AbstractHttpSecuritySource.DependencyLabeller, AbstractHttpSecuritySource.Labeller, AbstractHttpSecuritySource.MetaDataContext<A,AC extends java.io.Serializable,C,O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractHttpSecuritySource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTHENTICATION_SCHEME
Authentication scheme reported to the application via theHttpAccessControl
.static java.lang.String
PROPERTY_REALM
Name ofProperty
to configure the realm.-
Fields inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
UTF_8
-
-
Constructor Summary
Constructors Constructor Description MockFlowHttpSecuritySource()
Default constructor.MockFlowHttpSecuritySource(java.lang.String realm)
Instantiate with the realm.
-
Method Summary
-
Methods inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
getSpecification, init, start, stop
-
-
-
-
Field Detail
-
PROPERTY_REALM
public static final java.lang.String PROPERTY_REALM
Name ofProperty
to configure the realm.- See Also:
- Constant Field Values
-
AUTHENTICATION_SCHEME
public static final java.lang.String AUTHENTICATION_SCHEME
Authentication scheme reported to the application via theHttpAccessControl
.- See Also:
- Constant Field Values
-
-
Method Detail
-
loadSpecification
protected void loadSpecification(AbstractHttpSecuritySource.SpecificationContext context)
Description copied from class:AbstractHttpSecuritySource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractHttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractHttpSecuritySource.MetaDataContext<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows> context) throws java.lang.Exception
Description copied from class:AbstractHttpSecuritySource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractHttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
sourceHttpSecurity
public HttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows> sourceHttpSecurity(HttpSecurityContext context) throws HttpException
Description copied from interface:HttpSecuritySource
Sources theHttpSecurity
.- Specified by:
sourceHttpSecurity
in interfaceHttpSecuritySource<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
-HttpSecurity
.- Returns:
HttpSecurity
.- Throws:
HttpException
- If fails to source theHttpSecurity
.
-
createAuthentication
public MockAuthentication createAuthentication(AuthenticationContext<MockAccessControl,MockCredentials> context)
Description copied from interface:HttpSecurity
Creates the custom authentication.- Specified by:
createAuthentication
in interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
-AuthenticateContext
.- Returns:
- Custom authentication.
-
ratify
public boolean ratify(MockCredentials credentials, RatifyContext<MockAccessControl> context)
Description copied from interface:HttpSecurity
Ratifies whether enough information is available to undertake authentication.
As authentication will likely require communication with external services (LDAP store, database, etc), this method allows checking whether enough information is available to undertake the authentication. The purpose is to avoid the
ManagedFunction
depending on dependencies of authentication subsequently causing execution by differentTeam
. This is especially as the majority ofHttpRequest
servicing will use theHttpSession
to cache details and not require the authentication dependencies causing the swap inTeam
.- Specified by:
ratify
in interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
credentials
- Credentials.context
-RatifyContext
.- Returns:
true
should enough information be available to undertake authentication.false
if not enough information is available for authentication.
-
authenticate
public void authenticate(MockCredentials credentials, AuthenticateContext<MockAccessControl,None,MockFlowHttpSecuritySource.Flows> context) throws HttpException
Description copied from interface:HttpSecurity
Undertakes authentication.- Specified by:
authenticate
in interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
credentials
- Credentials.context
-AuthenticateContext
.- Throws:
HttpException
- If failure in communicating to necessary security services.
-
challenge
public void challenge(ChallengeContext<None,MockFlowHttpSecuritySource.Flows> context) throws HttpException
Description copied from interface:HttpSecurity
Triggers the authentication challenge to the client.- Specified by:
challenge
in interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
-ChallengeContext
.- Throws:
HttpException
- If failure in communicating to necessary security services.
-
logout
public void logout(LogoutContext<None,MockFlowHttpSecuritySource.Flows> context) throws HttpException
Description copied from interface:HttpSecurity
Logs out.- Specified by:
logout
in interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>
- Parameters:
context
-LogoutContext
.- Throws:
HttpException
- If failure in communicating to necessary security services.
-
-