public class PrincipalExtractor
extends java.lang.Object
usernameClaim is looked up.
If not found the claim configured as fallbackUsernameClaim is looked up. If that one is found and if
the fallbackUsernamePrefix is configured prefix the found value with the prefix, otherwise not.| Constructor and Description |
|---|
PrincipalExtractor()
Create a new instance
|
PrincipalExtractor(java.lang.String usernameClaim,
java.lang.String fallbackUsernameClaim,
java.lang.String fallbackUsernamePrefix)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPrincipal(com.fasterxml.jackson.databind.JsonNode json)
Get the principal name
|
java.lang.String |
getSub(com.fasterxml.jackson.databind.JsonNode json)
Get the value of
sub claim |
boolean |
isConfigured()
Return true if any of the configuration options is configured
|
java.lang.String |
toString() |
public PrincipalExtractor()
public PrincipalExtractor(java.lang.String usernameClaim,
java.lang.String fallbackUsernameClaim,
java.lang.String fallbackUsernamePrefix)
usernameClaim - Attribute name for an attribute containing the user id to lookup firstfallbackUsernameClaim - Attribute name for an attribute containg the user id to lookup as a fallbackfallbackUsernamePrefix - A prefix to prepend to the value of the fallback attribute value if setpublic java.lang.String getPrincipal(com.fasterxml.jackson.databind.JsonNode json)
json - JWT token as a JsonNode objectpublic java.lang.String getSub(com.fasterxml.jackson.databind.JsonNode json)
sub claimjson - JWT token as a JsonNode objectsub attributepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isConfigured()
Copyright © 2023. All rights reserved.