Class IdTokenHelper.ClaimsBuilder
java.lang.Object
de.hybris.platform.oauth2.jwt.util.IdTokenHelper.ClaimsBuilder
- Enclosing class:
- IdTokenHelper
The Builder for Claims.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a generic claim.Adds the scope to existing scope claim (for a given name).exp(int seconds) Adds the exp claim (using new Date().getTime() + seconds * 1000).Gets the claims as a map.iat()Adds the iat claim (using new Date().getTime()).Adds iss (issuer) claim.Adds nonce claim.Sets the scopes claim (for a given name).Adds state claim.Adds sub claim.
-
Field Details
-
CLAIMS_SCOPE_NAME
- See Also:
-
-
Constructor Details
-
ClaimsBuilder
public ClaimsBuilder()
-
-
Method Details
-
iss
Adds iss (issuer) claim.- Parameters:
iss- the issuer- Returns:
- the claims builder
-
sub
Adds sub claim.- Parameters:
sub- the sub- Returns:
- the claims builder
-
nonce
Adds nonce claim.- Parameters:
nonce- the nonce- Returns:
- the claims builder
-
state
Adds state claim.- Parameters:
state- the (web) state- Returns:
- the claims builder
-
setScopes
Sets the scopes claim (for a given name).- Parameters:
name- the name of the scopes claim (usually should be "scope")scopes- the scopes- Returns:
- the claims builder
-
addScopes
Adds the scope to existing scope claim (for a given name).- Parameters:
name- the name of the scopes claim (usually should be "scope")scopes- the scopes- Returns:
- the claims builder
-
iat
Adds the iat claim (using new Date().getTime()).- Returns:
- the claims builder
-
exp
Adds the exp claim (using new Date().getTime() + seconds * 1000).- Parameters:
seconds- after how many seconds should expire- Returns:
- the claims builder
-
addClaim
Adds a generic claim.- Parameters:
key- the key - name of the claimvalue- the value- Returns:
- the claims builder
-
getClaims
Gets the claims as a map.- Returns:
- the claims
-