Class AnonymousHttpSecuritySource
java.lang.Object
net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl,Void,None,None>
net.officefloor.web.security.scheme.AnonymousHttpSecuritySource
- All Implemented Interfaces:
Serializable,HttpAccessControl,HttpAuthentication<Void>,HttpSecurity<HttpAuthentication<Void>,,HttpAccessControl, Void, None, None> HttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl, Void, None, None>
public class AnonymousHttpSecuritySource
extends AbstractHttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl,Void,None,None>
implements HttpSecurity<HttpAuthentication<Void>,HttpAccessControl,Void,None,None>, HttpAuthentication<Void>, HttpAccessControl
HttpSecurity enable access to all roles.- Author:
- Daniel Sagenschneider
- See Also:
-
Nested Class Summary
Nested 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
Fields inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
UTF_8 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(Void credentials, AuthenticateRequest authenticateRequest) Triggers to undertake authentication.voidauthenticate(Void credentials, AuthenticateContext<HttpAccessControl, None, None> context) Undertakes authentication.voidchallenge(ChallengeContext<None, None> context) Triggers the authentication challenge to the client.Creates the custom authentication.Obtains theHttpAccessControl.Obtains the authentication scheme used.Obtains the type of credentials.Obtains thePrincipal.booleanIndicates if within role.booleanIndicates if authenticated.protected voidloadMetaData(AbstractHttpSecuritySource.MetaDataContext<HttpAuthentication<Void>, HttpAccessControl, Void, None, None> context) Overridden to load meta-data.protected voidOverridden to load specifications.voidlogout(LogoutRequest logoutRequest) Undertakes logging out.voidlogout(LogoutContext<None, None> context) Logs out.booleanratify(Void credentials, RatifyContext<HttpAccessControl> context) Ratifies whether enough information is available to undertake authentication.sourceHttpSecurity(HttpSecurityContext context) Sources theHttpSecurity.Methods inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
getSpecification, init, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.web.security.HttpAccessControl
isAccess
-
Constructor Details
-
AnonymousHttpSecuritySource
public AnonymousHttpSecuritySource()
-
-
Method Details
-
loadSpecification
Description copied from class:AbstractHttpSecuritySourceOverridden to load specifications.- Specified by:
loadSpecificationin classAbstractHttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractHttpSecuritySource.MetaDataContext<HttpAuthentication<Void>, HttpAccessControl, throws ExceptionVoid, None, None> context) Description copied from class:AbstractHttpSecuritySourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractHttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
sourceHttpSecurity
public HttpSecurity<HttpAuthentication<Void>,HttpAccessControl, sourceHttpSecurityVoid, None, None> (HttpSecurityContext context) throws HttpException Description copied from interface:HttpSecuritySourceSources theHttpSecurity.- Specified by:
sourceHttpSecurityin interfaceHttpSecuritySource<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
context-HttpSecurity.- Returns:
HttpSecurity.- Throws:
HttpException- If fails to source theHttpSecurity.
-
createAuthentication
public HttpAuthentication<Void> createAuthentication(AuthenticationContext<HttpAccessControl, Void> context) Description copied from interface:HttpSecurityCreates the custom authentication.- Specified by:
createAuthenticationin interfaceHttpSecurity<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - 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<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - 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(Void credentials, AuthenticateContext<HttpAccessControl, None, throws HttpExceptionNone> context) Description copied from interface:HttpSecurityUndertakes authentication.- Specified by:
authenticatein interfaceHttpSecurity<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
credentials- Credentials.context-AuthenticateContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
challenge
Description copied from interface:HttpSecurityTriggers the authentication challenge to the client.- Specified by:
challengein interfaceHttpSecurity<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
context-ChallengeContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
logout
Description copied from interface:HttpSecurityLogs out.- Specified by:
logoutin interfaceHttpSecurity<HttpAuthentication<Void>,HttpAccessControl, Void, None, None> - Parameters:
context-LogoutContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
isAuthenticated
Description copied from interface:HttpAuthenticationIndicates if authenticated.- Specified by:
isAuthenticatedin interfaceHttpAuthentication<Void>- Returns:
trueif authenticated.- Throws:
HttpException- If authentication has been attempted but there were failures in undertaking authentication.
-
getCredentialsType
Description copied from interface:HttpAuthenticationObtains the type of credentials.- Specified by:
getCredentialsTypein interfaceHttpAuthentication<Void>- Returns:
- Type of credentials.
-
authenticate
Description copied from interface:HttpAuthenticationTriggers to undertake authentication.- Specified by:
authenticatein interfaceHttpAuthentication<Void>- Parameters:
credentials- Credentials. May benullif no credentials are required, or they are pulled from theHttpRequest.authenticateRequest-AuthenticateRequest.
-
getAccessControl
Description copied from interface:HttpAuthenticationObtains theHttpAccessControl.- Specified by:
getAccessControlin interfaceHttpAuthentication<Void>- Returns:
HttpAccessControl.
-
logout
Description copied from interface:HttpAuthenticationUndertakes logging out.- Specified by:
logoutin interfaceHttpAuthentication<Void>- Parameters:
logoutRequest-LogoutRequest.
-
getAuthenticationScheme
Description copied from interface:HttpAccessControlObtains the authentication scheme used.- Specified by:
getAuthenticationSchemein interfaceHttpAccessControl- Returns:
- Authentication scheme.
-
getPrincipal
Description copied from interface:HttpAccessControlObtains thePrincipal.- Specified by:
getPrincipalin interfaceHttpAccessControl- Returns:
Principal.
-
inRole
Description copied from interface:HttpAccessControlIndicates if within role.- Specified by:
inRolein interfaceHttpAccessControl- Parameters:
role- Role to check if have access.- Returns:
trueif supports the role.
-