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>
Mock
HttpSecuritySource that challenges with a HTML form.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
AbstractHttpSecuritySource.DependencyLabeller, AbstractHttpSecuritySource.Labeller, AbstractHttpSecuritySource.MetaDataContext<A,AC extends Serializable, C, O extends Enum<O>, F extends Enum<F>>, AbstractHttpSecuritySource.SpecificationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAuthentication scheme reported to the application via theHttpAccessControl.static final StringName ofPropertyto configure the realm.Fields inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
UTF_8 -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.MockFlowHttpSecuritySource(String realm) Instantiate with the realm. -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(MockCredentials credentials, AuthenticateContext<MockAccessControl, None, MockFlowHttpSecuritySource.Flows> context) Undertakes authentication.voidTriggers the authentication challenge to the client.Creates the custom authentication.protected voidloadMetaData(AbstractHttpSecuritySource.MetaDataContext<MockAuthentication, MockAccessControl, MockCredentials, None, MockFlowHttpSecuritySource.Flows> context) Overridden to load meta-data.protected voidOverridden to load specifications.voidLogs out.booleanratify(MockCredentials credentials, RatifyContext<MockAccessControl> context) Ratifies whether enough information is available to undertake authentication.HttpSecurity<MockAuthentication,MockAccessControl, MockCredentials, None, MockFlowHttpSecuritySource.Flows> sourceHttpSecurity(HttpSecurityContext context) Sources theHttpSecurity.Methods inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
getSpecification, init, start, stop
-
Field Details
-
PROPERTY_REALM
Name ofPropertyto configure the realm.- See Also:
-
AUTHENTICATION_SCHEME
Authentication scheme reported to the application via theHttpAccessControl.- See Also:
-
-
Constructor Details
-
MockFlowHttpSecuritySource
Instantiate with the realm.- Parameters:
realm- Realm.
-
MockFlowHttpSecuritySource
public MockFlowHttpSecuritySource()Default constructor.
-
-
Method Details
-
loadSpecification
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, throws ExceptionMockCredentials, None, MockFlowHttpSecuritySource.Flows> context) Description copied from class:AbstractHttpSecuritySourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractHttpSecuritySource<MockAuthentication,MockAccessControl, MockCredentials, None, MockFlowHttpSecuritySource.Flows> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
sourceHttpSecurity
public HttpSecurity<MockAuthentication,MockAccessControl, sourceHttpSecurityMockCredentials, None, MockFlowHttpSecuritySource.Flows> (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
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, throws HttpExceptionMockFlowHttpSecuritySource.Flows> context) 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 HttpExceptionDescription 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 HttpExceptionDescription 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.
-