Interface ClaimAccessor
- All Known Subinterfaces:
IdTokenClaimAccessor, JwtClaimAccessor, LogoutTokenClaimAccessor, OAuth2AuthorizationServerMetadataClaimAccessor, OAuth2ClientMetadataClaimAccessor, OAuth2ProtectedResourceMetadataClaimAccessor, OAuth2TokenClaimAccessor, OAuth2TokenIntrospectionClaimAccessor, OidcClientMetadataClaimAccessor, OidcProviderMetadataClaimAccessor, OidcUser, StandardClaimAccessor
- All Known Implementing Classes:
AbstractOAuth2AuthorizationServerMetadata, AbstractOAuth2ClientRegistration, DefaultOidcUser, Jwt, JwtClaimsSet, OAuth2AuthorizationServerMetadata, OAuth2ClientRegistration, OAuth2IntrospectionAuthenticatedPrincipal, OAuth2ProtectedResourceMetadata, OAuth2TokenClaimsSet, OAuth2TokenExchangeActor, OAuth2TokenIntrospection, OidcClientRegistration, OidcIdToken, OidcLogoutToken, OidcProviderConfiguration, OidcUserInfo
public interface ClaimAccessor
An "accessor" for a set of claims that may be used for assertions.
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> @Nullable TReturns the claim value as aTtype.default @Nullable BooleangetClaimAsBoolean(String claim) Returns the claim value as aBooleanornullif the claim does not exist.default @Nullable InstantgetClaimAsInstant(String claim) Returns the claim value as anInstantornullif it does not exist.getClaimAsMap(String claim) Returns the claim value as aMap<String, Object>ornullif the claim does not exist.default @Nullable StringgetClaimAsString(String claim) Returns the claim value as aStringornullif it does not exist or is equal tonull.getClaimAsStringList(String claim) Returns the claim value as aList<String>ornullif the claim does not exist.default @Nullable URLgetClaimAsURL(String claim) Returns the claim value as anURLornullif it does not exist.Returns a set of claims that may be used for assertions.default boolean
-
Method Details
-
getClaims
-
getClaim
Returns the claim value as aTtype. The claim value is expected to be of typeT.- Type Parameters:
T- the type of the claim value- Parameters:
claim- the name of the claim- Returns:
- the claim value, or
nullif the claim does not exist - Since:
- 5.2
-
hasClaim
- Parameters:
claim- the name of the claim- Returns:
trueif the claim exists, otherwisefalse- Since:
- 5.5
-
getClaimAsString
-
getClaimAsBoolean
Returns the claim value as aBooleanornullif the claim does not exist.- Parameters:
claim- the name of the claim- Returns:
- the claim value or
nullif the claim does not exist - Throws:
IllegalArgumentException- if the claim value cannot be converted to aBoolean
-
getClaimAsInstant
Returns the claim value as anInstantornullif it does not exist.- Parameters:
claim- the name of the claim- Returns:
- the claim value or
nullif it does not exist - Throws:
IllegalArgumentException- if the claim value cannot be converted to anInstant
-
getClaimAsURL
Returns the claim value as anURLornullif it does not exist.- Parameters:
claim- the name of the claim- Returns:
- the claim value or
nullif it does not exist - Throws:
IllegalArgumentException- if the claim value cannot be converted to aURL
-
getClaimAsMap
Returns the claim value as aMap<String, Object>ornullif the claim does not exist.- Parameters:
claim- the name of the claim- Returns:
- the claim value or
nullif the claim does not exist - Throws:
IllegalArgumentException- if the claim value cannot be converted to aMap
-
getClaimAsStringList
Returns the claim value as aList<String>ornullif the claim does not exist.- Parameters:
claim- the name of the claim- Returns:
- the claim value or
nullif the claim does not exist - Throws:
IllegalArgumentException- if the claim value cannot be converted to aList
-