| Modifier and Type | Method and Description |
|---|---|
default String |
getAttributeFromClaimAsString(String claimName,
String attributeName)
Returns the String value of a claim attribute.
|
default List<String> |
getAttributeFromClaimAsStringList(String claimName,
String attributeName)
Returns the String list of a claim attribute.
|
GrantType |
getGrantType()
Returns the grant type of the jwt token.
|
Set<String> |
getScopes()
Returns the list of the claim "scope".
|
boolean |
hasLocalScope(String scope)
Check if a local scope is available in the authentication token.
|
boolean |
hasScope(String scope)
Checks if a scope is available in the access token.
|
getAudiences, getClaimAsJsonObject, getClaimAsString, getClaimAsStringList, getExpiration, getHeaderParameterAsString, getNotBefore, getPrincipal, getService, getTokenValue, getZoneId, hasClaim, hasHeaderParameter, isExpiredSet<String> getScopes()
boolean hasScope(String scope)
scope - name of the scopeboolean hasLocalScope(@Nonnull String scope)
scope - name of local scope@Nullable GrantType getGrantType()
@Nullable default String getAttributeFromClaimAsString(String claimName, String attributeName)
"claimName": {
"attributeName": "attributeValueAsString"
},
import static com.sap.cloud.security.token.TokenClaims.XSUAA.*;
token.getAttributeFromClaimAsString(EXTERNAL_ATTRIBUTE, EXTERNAL_ATTRIBUTE_SUBACCOUNTID);
@Nullable default List<String> getAttributeFromClaimAsStringList(String claimName, String attributeName)
"claimName": {
"attributeName": ["attributeValueAsString", "attributeValue2AsString"]
},
import static com.sap.cloud.security.token.TokenClaims.XSUAA.*;
token.getAttributeFromClaimAsString(XS_USER_ATTRIBUTES, "custom_role");
Copyright © 2020. All rights reserved.