JWT Class
Namespace
Usage
Use the methods in this class to generate the payload in a JWT bearer token for the OAuth 2.0 JWT bearer token flow. For more information and a full code sample, see JWTBearerTokenExchange Class.
JWT Methods
The following are methods for JWT. All are instance methods.
getAdditionalClaims()
Signature
public Map<String,Object> getAdditionalClaims()
Return Value
The claims returned depend on how the JWT was generated.
If the JWT was generated using other methods in the Auth.JWT class, this method returns the claims that were set using the setAdditionalClaims method.
For JWTs generated using methods in the Auth.JWTUtil class, the getAdditionalClaims method returns all claims except for these three.
- aud (audience)—Use the getAud method instead.
- iss (issuer)—Use the getIss method instead.
- sub (subject)—Use the getSub method instead.
For these JWTs, when the incoming JWT has a claim that stores an inner JSON list, the claim value is returned as a string.
getNbfClockSkew()
Signature
public Integer getNbfClockSkew()
Return Value
Type: Integer
getValidityLength()
Signature
public Integer getValidityLength()
Return Value
Type: Integer
setAdditionalClaims(additionalClaims)
Signature
public void setAdditionalClaims(Map<String,Object> additionalClaims)
Return Value
Type: void
Usage
Additional claims must not include any standard claims.
setAud(aud)
setIss(iss)
setNbfClockSkew(nbfClockSkew)
Signature
public void setNbfClockSkew(Integer nbfClockSkew)
Parameters
- nbfClockSkew
- Type: Integer
Return Value
Type: void
setSub(sub)
setValidityLength(validityLength)
Signature
public void setValidityLength(Integer validityLength)
Parameters
- validityLength
- Type: Integer
Return Value
Type: void