Package net.officefloor.web.spi.security
Interface HttpSecurity<A,AC extends Serializable,C,O extends Enum<O>,F extends Enum<F>>
- All Known Implementing Classes:
AbstractMockHttpSecuritySource,AnonymousHttpSecuritySource,JwtHttpSecuritySource,MockChallengeHttpSecuritySource,MockFlowHttpSecuritySource
public interface HttpSecurity<A,AC extends Serializable,C,O extends Enum<O>,F extends Enum<F>>
HTTP security.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(C credentials, AuthenticateContext<AC, O, F> context) Undertakes authentication.voidchallenge(ChallengeContext<O, F> context) Triggers the authentication challenge to the client.createAuthentication(AuthenticationContext<AC, C> context) Creates the custom authentication.voidlogout(LogoutContext<O, F> context) Logs out.booleanratify(C credentials, RatifyContext<AC> context) Ratifies whether enough information is available to undertake authentication.
-
Method Details
-
createAuthentication
Creates the custom authentication.- Parameters:
context-AuthenticateContext.- Returns:
- Custom authentication.
-
ratify
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
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.- Parameters:
credentials- Credentials.context-RatifyContext.- Returns:
trueshould enough information be available to undertake authentication.falseif not enough information is available for authentication.
-
authenticate
Undertakes authentication.- Parameters:
credentials- Credentials.context-AuthenticateContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
challenge
Triggers the authentication challenge to the client.- Parameters:
context-ChallengeContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-
logout
Logs out.- Parameters:
context-LogoutContext.- Throws:
HttpException- If failure in communicating to necessary security services.
-