public class ConnectionSecurityContext extends Object
Collection
of Principal
s for the remote user to be obtained, the API then allows for an alternative identity
to be pushed by interceptors for validation in the security interceptors for subsequent EJB invocations.Modifier and Type | Method and Description |
---|---|
static Collection<Principal> |
getConnectionPrincipals()
Obtain a
Collection containing the Principal instances for the user associated with the connection. |
static void |
popIdentity(ContextStateCache stateCache)
Pop the identity previously associated and restore internal state to it's previous value.
|
static ContextStateCache |
pushIdentity(Principal principal,
Object credential)
Push a new
Principal and Credential pair. |
public static Collection<Principal> getConnectionPrincipals()
Collection
containing the Principal
instances for the user associated with the connection.
Note: This method should be called from within a PrivilegedAction
.null
will be returned if no connection is associated with
the Thread
public static ContextStateCache pushIdentity(Principal principal, Object credential) throws Exception
Principal
and Credential pair.
This method is to be called before an EJB invocation is passed through it's security interceptor, at that point the
Principal and Credential pair can be verified.
Note: This method should be called from within a PrivilegedAction
.principal
- - The alternative Principal
to use in verification before the next EJB is called.credential
- - The credential to verify with the ContextStateCache
that can later be used to pop the identity pushed here and restore internal state to it's previous values.Exception
- If there is a problem associating the new Principal
and Credential pair.public static void popIdentity(ContextStateCache stateCache)
stateCache
- - The cache containing the state as it was when pushIdentity was called.Copyright © 2019 JBoss by Red Hat. All rights reserved.