AuthenticatedIdentity
, Principal
public class DefaultAuthenticatedIdentity extends Object implements AuthenticatedIdentity
This implementation is an immutable structure, with a facility to store it in TLS. It's the responsibility of the context, e.g. the HTTP request handler, to remove the identity from TLS at the end of the context (e.g. end of the HTTP request), or at any other appropriate time (e.g. when logging out mid-request).
Constructor | Description |
---|---|
DefaultAuthenticatedIdentity(Principal callerPrincipal,
Set<String> groups) |
Modifier and Type | Method | Description |
---|---|---|
static void |
clear() |
|
Principal |
getCallerPrincipal() |
Returns the caller principal, which represents the primary name of the calling entity (aka the "caller")
to a server.
|
static AuthenticatedIdentity |
getCurrentIdentity() |
|
static Subject |
getCurrentSubject() |
|
Set<String> |
getGroups() |
The groups the caller is in.
|
static void |
setCurrentIdentity(AuthenticatedIdentity identity) |
|
static void |
setCurrentIdentity(Principal callerPrincipal,
Set<String> groups) |
getName
public static void setCurrentIdentity(Principal callerPrincipal, Set<String> groups)
public static void setCurrentIdentity(AuthenticatedIdentity identity)
public static Subject getCurrentSubject()
public static AuthenticatedIdentity getCurrentIdentity()
public static void clear()
public Principal getCallerPrincipal()
AuthenticatedIdentity
getCallerPrincipal
in interface AuthenticatedIdentity
public Set<String> getGroups()
AuthenticatedIdentity
If group to role mapping is not active (the default) groups are equal to roles.
getGroups
in interface AuthenticatedIdentity
Copyright © 2020 Piranha Cloud. All rights reserved.