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>
MockHttpSecuritySourcethat challenges with a HTML form.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMockFlowHttpSecuritySource.FlowsFlowkeys.-
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.StringAUTHENTICATION_SCHEMEAuthentication scheme reported to the application via theHttpAccessControl.static java.lang.StringPROPERTY_REALMName ofPropertyto 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 ofPropertyto 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:AbstractHttpSecuritySourceOverridden to load specifications.- Specified by:
loadSpecificationin 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:AbstractHttpSecuritySourceOverridden to load meta-data.- Specified by:
loadMetaDatain 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:HttpSecuritySourceSources theHttpSecurity.- Specified by:
sourceHttpSecurityin 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:HttpSecurityCreates the custom authentication.- Specified by:
createAuthenticationin 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:HttpSecurityRatifies 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
ManagedFunctiondepending on dependencies of authentication subsequently causing execution by differentTeam. This is especially as the majority ofHttpRequestservicing will use theHttpSessionto cache details and not require the authentication dependencies causing the swap inTeam.- Specified by:
ratifyin interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>- Parameters:
credentials- Credentials.context-RatifyContext.- Returns:
trueshould enough information be available to undertake authentication.falseif 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:HttpSecurityUndertakes authentication.- Specified by:
authenticatein 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:HttpSecurityTriggers the authentication challenge to the client.- Specified by:
challengein 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:HttpSecurityLogs out.- Specified by:
logoutin interfaceHttpSecurity<MockAuthentication,MockAccessControl,MockCredentials,None,MockFlowHttpSecuritySource.Flows>- Parameters:
context-LogoutContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
-