Interface SecurityManager<A extends Credentials,B extends Identity,C extends AccessController>
- Type Parameters:
A
- the type of credentials to authenticateB
- the identity typeC
- the access controller type
A security manager authenticate the credentials of an entity and obtain the SecurityContext
used to protect services and resources in the application.
A security manager implementation shall rely on an Authenticator
to authenticate credentials, an IdentityResolver
to resolve the identity of the authenticated entity and an
AccessControllerResolver
to get the access controller for the authenticated entity in order to create the SecurityContext
.
The resulting security context can then be used to protect sensitive services or resources.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(A credentials) Authenticates the specified credentials and returns the corresponding security context.static <A extends Credentials,
B extends Authentication, C extends Identity, D extends AccessController>
SecurityManager<A, C, D> of
(Authenticator<? super A, ? extends B> authenticator) Creates a security manager with the specified authenticator.static <A extends Credentials,
B extends Authentication, C extends Identity, D extends AccessController>
SecurityManager<A, C, D> of
(Authenticator<? super A, ? extends B> authenticator, AccessControllerResolver<? super B, ? extends D> accessControllerResolver) Creates a security manager with the specified authenticator and access controller resolver.static <A extends Credentials,
B extends Authentication, C extends Identity, D extends AccessController>
SecurityManager<A, C, D> of
(Authenticator<? super A, ? extends B> authenticator, IdentityResolver<? super B, ? extends C> identityResolver) Creates a security manager with the specified authenticator and identity resolver.static <A extends Credentials,
B extends Authentication, C extends Identity, D extends AccessController>
SecurityManager<A, C, D> of
(Authenticator<? super A, ? extends B> authenticator, IdentityResolver<? super B, ? extends C> identityResolver, AccessControllerResolver<? super B, ? extends D> accessControllerResolver) Creates a security manager with the specified authenticator, identity resolver and access controller resolver.
-
Method Details
-
of
static <A extends Credentials,B extends Authentication, SecurityManager<A,C extends Identity, D extends AccessController> C, ofD> (Authenticator<? super A, ? extends B> authenticator) Creates a security manager with the specified authenticator.
The security contexts created using the resulting security manager will have no identity and no access controller since corresponding resolvers are missing.
- Type Parameters:
A
- credentials type to authenticateB
- the authentication resulting from a successful authentication and used to resolve identity and access controllerC
- the identity typeD
- the access controller type- Parameters:
authenticator
- the authenticator- Returns:
- a new security manager
-
of
static <A extends Credentials,B extends Authentication, SecurityManager<A,C extends Identity, D extends AccessController> C, ofD> (Authenticator<? super A, ? extends B> authenticator, IdentityResolver<? super B, ? extends C> identityResolver) Creates a security manager with the specified authenticator and identity resolver.
The security contexts created using the resulting security manager will have no access controller since corresponding resolver is missing.
- Type Parameters:
A
- credentials type to authenticateB
- the authentication resulting from a successful authentication and used to resolve identity and access controllerC
- the identity typeD
- the access controller type- Parameters:
authenticator
- the authenticatoridentityResolver
- the identity resolver- Returns:
- a new security manager
-
of
static <A extends Credentials,B extends Authentication, SecurityManager<A,C extends Identity, D extends AccessController> C, ofD> (Authenticator<? super A, ? extends B> authenticator, AccessControllerResolver<? super B, ? extends D> accessControllerResolver) Creates a security manager with the specified authenticator and access controller resolver.
The security contexts created using the resulting security manager will have no identity since corresponding resolver is missing.
- Type Parameters:
A
- credentials type to authenticateB
- the authentication resulting from a successful authentication and used to resolve identity and access controllerC
- the identity typeD
- the access controller type- Parameters:
authenticator
- the authenticatoraccessControllerResolver
- the access controller resolver- Returns:
- a new security manager
-
of
static <A extends Credentials,B extends Authentication, SecurityManager<A,C extends Identity, D extends AccessController> C, ofD> (Authenticator<? super A, ? extends B> authenticator, IdentityResolver<? super B, ? extends C> identityResolver, AccessControllerResolver<? super B, ? extends D> accessControllerResolver) Creates a security manager with the specified authenticator, identity resolver and access controller resolver.
- Type Parameters:
A
- credentials type to authenticateB
- the authentication resulting from a successful authentication and used to resolve identity and access controllerC
- the identity typeD
- the access controller type- Parameters:
authenticator
- the authenticatoridentityResolver
- the identity resolveraccessControllerResolver
- the access controller resolver- Returns:
- a new security manager
-
authenticate
Authenticates the specified credentials and returns the corresponding security context.
This method authenticates the credentials, then resolve the identiy and the access controller and finally create the resulting security context which can be:
- anonymous (i.e. not authenticated with no cause) when specifying null credentials.
- denied when an error was raised during the authentication process or identity and access controller resolutions.
- granted when the security manager was able to authenticated credentials, resolve identity and access controller.
- Parameters:
credentials
- the credentials to authenticate or null to get an anonymous security context- Returns:
- a mono emitting the resulting security context
-