The following target entities are supported:
java.security.Principal containing the
name of the current authenticated user.
java.lang.String representing the logical application role
associated with the caller principal.
A PrincipalMapper is intended to be used by a Policy, but should work
outside a Policy (for instance, during request processing in a Servlet container).
| Modifier and Type | Method and Description |
|---|---|
| public Principal | Returns: Principal representing the name of the current authenticated user, or null if not authenticated.the subject from which the caller principal is to be retrieved. subject)Pick from the principals within the passed-in Subject the platform-specific |
| public default Principal | Returns: Principal representing the name of the current authenticated user, or null if not authenticated.the set of principals from which the caller principal is to be retrieved. principals)Pick from the principals within the passed-in set of principals the platform-specific
|
| public Set | Returns: a set of logical application roles associated with the caller principal.the subject from which the roles are to be retrieved. subject)Pick from the principals within the passed-in Subject all application roles that are associated with the caller principal. |
| public default Set | Returns: a set of logical application roles associated with the caller principal.the set of principals from which the roles are to be retrieved. principals)Pick from the principals within the passed-in set of principals all application roles that are associated with the caller principal. |
| public default boolean | Returns: true if the special "**" role has been mapped to something else, false otherwise.Jakarta Security defines the "any authenticated caller role" as "**" and allows an application specific mapping for this role to be established. |
| getCallerPrincipal | back to summary |
|---|---|
| public Principal getCallerPrincipal(Subject subject) Pick from the principals within the passed-in Subject the platform-specific | |
| getCallerPrincipal | back to summary |
|---|---|
| public default Principal getCallerPrincipal(Set<Principal> principals) Pick from the principals within the passed-in set of principals the platform-specific
| |
| getMappedRoles | back to summary |
|---|---|
| public Set Pick from the principals within the passed-in Subject all application roles that are associated with the caller principal. The roles returned here are the logical application roles. If the principals in the passed-in Subject represent non-application roles (called "groups"), the implementation must perform the group-to-role mapping. For instance, if a Principal representing the group "adm" is present in the Subject, and the group "adm" is mapped (in a implementation specific way) to "administrator", then "administrator" must be returned here. | |
| getMappedRoles | back to summary |
|---|---|
| public default Set Pick from the principals within the passed-in set of principals all application roles that are associated with the caller principal. The roles returned here are the logical application roles. If the principals in the passed-in Subject represent non-application roles (called "groups"), the implementation must perform the group-to-role mapping. For instance, if a Principal representing the group "adm" is present in the Subject, and the group "adm" is mapped (in a implementation specific way) to "administrator", then "administrator" must be returned here. | |
| isAnyAuthenticatedUserRoleMapped | back to summary |
|---|---|
| public default boolean isAnyAuthenticatedUserRoleMapped() Jakarta Security defines the "any authenticated caller role" as "**" and allows an application specific mapping for this role to be established. E.g. "**" could be mapped to the logical application role "admin". This method is used to discover if such a mapping has indeed been done. If it has been done, "**" is a regular role name and we can no longer check for "any authenticated caller" using "**".
| |