Package org.keycloak.representations
Class ClaimsRepresentation
- java.lang.Object
-
- org.keycloak.representations.ClaimsRepresentation
-
public class ClaimsRepresentation extends Object
Claims parameter as described in the OIDC specification https://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter- Author:
- Marek Posolda
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClaimsRepresentation.ClaimContext
static class
ClaimsRepresentation.ClaimValue<CLAIM_TYPE>
-
Constructor Summary
Constructors Constructor Description ClaimsRepresentation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <CLAIM_TYPE>
ClaimsRepresentation.ClaimValue<CLAIM_TYPE>getClaimValue(String claimName, ClaimsRepresentation.ClaimContext ctx, Class<CLAIM_TYPE> claimType)
Map<String,ClaimsRepresentation.ClaimValue>
getIdTokenClaims()
Map<String,ClaimsRepresentation.ClaimValue>
getUserinfoClaims()
boolean
isPresent(String claimName, ClaimsRepresentation.ClaimContext ctx)
boolean
isPresentAsNullClaim(String claimName, ClaimsRepresentation.ClaimContext ctx)
void
setIdTokenClaims(Map<String,ClaimsRepresentation.ClaimValue> idTokenClaims)
void
setUserinfoClaims(Map<String,ClaimsRepresentation.ClaimValue> userinfoClaims)
-
-
-
Method Detail
-
getIdTokenClaims
public Map<String,ClaimsRepresentation.ClaimValue> getIdTokenClaims()
-
setIdTokenClaims
public void setIdTokenClaims(Map<String,ClaimsRepresentation.ClaimValue> idTokenClaims)
-
getUserinfoClaims
public Map<String,ClaimsRepresentation.ClaimValue> getUserinfoClaims()
-
setUserinfoClaims
public void setUserinfoClaims(Map<String,ClaimsRepresentation.ClaimValue> userinfoClaims)
-
isPresent
public boolean isPresent(String claimName, ClaimsRepresentation.ClaimContext ctx)
- Parameters:
claimName
-ctx
- Whether we ask for claim to be presented in idToken or userInfo- Returns:
- true if claim is presented in the claims parameter either as "null" claim (See OIDC specification for definition of null claim) or claim with some value
-
isPresentAsNullClaim
public boolean isPresentAsNullClaim(String claimName, ClaimsRepresentation.ClaimContext ctx)
- Parameters:
claimName
-ctx
- Whether we ask for claim to be presented in idToken or userInfo- Returns:
- true if claim is presented in the claims parameter as "null" claim (See OIDC specification for definition of null claim)
-
getClaimValue
public <CLAIM_TYPE> ClaimsRepresentation.ClaimValue<CLAIM_TYPE> getClaimValue(String claimName, ClaimsRepresentation.ClaimContext ctx, Class<CLAIM_TYPE> claimType)
- Parameters:
claimName
-ctx
- Whether we ask for claim to be presented in idToken or userInfoclaimType
- claimType class- Returns:
- Claim value
-
-