public interface RunAsManager
Authenticationobject for the current secure object invocation only.
This interface permits implementations to replace the
Authentication object that applies to the current secure
object invocation only. The
AbstractSecurityInterceptor will replace
Authentication object held in the
for the duration of the secure object callback only, returning it to
Authentication object when the callback ends.
This is provided so that systems with two layers of objects can be
established. One layer is public facing and has normal secure methods with
the granted authorities expected to be held by external callers. The other
layer is private, and is only expected to be called by objects within the
public facing layer. The objects in this private layer still need security
(otherwise they would be public methods) and they also need security in
such a manner that prevents them being called directly by external callers.
The objects in the private layer would be configured to require granted
authorities never granted to external callers. The
RunAsManager interface provides a mechanism to elevate
security in this manner.
It is expected implementations will provide a corresponding concrete
AuthenticationProvider so that
Authentication object can be authenticated.
Some form of security will need to be implemented to ensure the
AuthenticationProvider only accepts
Authentication objects created by an authorized concrete
|Modifier and Type||Method and Description|
Returns a replacement
Indicates whether the
Indicates whether this
Authentication buildRunAs(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)
Authenticationobject for the current secure object invocation, or
nullif replacement not required.
authentication- the caller invoking the secure object
object- the secured object being called
attributes- the configuration attributes associated with the secure object being invoked
Authenticationshould be left as is
boolean supports(ConfigAttribute attribute)
RunAsManageris able to process the passed
This allows the
AbstractSecurityInterceptor to check every
configuration attribute can be consumed by the configured
attribute- a configuration attribute that has been configured against the
RunAsManagercan support the passed configuration attribute
boolean supports(Class<?> clazz)
RunAsManagerimplementation is able to provide run-as replacement for the indicated secure object type.
clazz- the class that is being queried