Package com.ibm.websphere.security.jwt
Interface Claims
-
- All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>
public interface Claims extends java.util.Map<java.lang.String,java.lang.Object>
TheClaims
interface represents JSON Web Token (JWT) payload claims and offers convenient get methods for some of the well known JWT claims such as "iss", "exp", and "iat".- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUDIENCE
The AUDIENCE is used to represent the "aud" claimstatic java.lang.String
AZP
The AZP is used to represent the "azp" claimstatic java.lang.String
EXPIRATION
The EXPIRATION is used to represent the "exp" claimstatic java.lang.String
ID
The ID is used to represent the "jti" claimstatic java.lang.String
ISSUED_AT
The ISSUED_AT is used to represent the "iat" claimstatic java.lang.String
ISSUER
The ISSUER is used to represent the "iss" claimstatic java.lang.String
NOT_BEFORE
The NOT_BEFORE is used to represent the "nbf" claimstatic java.lang.String
SUBJECT
The SUBJECT is used to represent the "sub" claimstatic java.lang.String
TOKEN_TYPE
The TOKEN_TYPE is used to represent the "token_type" claim
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getAllClaims()
java.util.List<java.lang.String>
getAudience()
java.lang.String
getAuthorizedParty()
<T> T
getClaim(java.lang.String claimName, java.lang.Class<T> requiredType)
long
getExpiration()
long
getIssuedAt()
java.lang.String
getIssuer()
java.lang.String
getJwtId()
long
getNotBefore()
java.lang.String
getSubject()
java.lang.String
toJsonString()
-
-
-
Field Detail
-
ISSUER
static final java.lang.String ISSUER
The ISSUER is used to represent the "iss" claim- See Also:
- Constant Field Values
-
SUBJECT
static final java.lang.String SUBJECT
The SUBJECT is used to represent the "sub" claim- See Also:
- Constant Field Values
-
AUDIENCE
static final java.lang.String AUDIENCE
The AUDIENCE is used to represent the "aud" claim- See Also:
- Constant Field Values
-
EXPIRATION
static final java.lang.String EXPIRATION
The EXPIRATION is used to represent the "exp" claim- See Also:
- Constant Field Values
-
NOT_BEFORE
static final java.lang.String NOT_BEFORE
The NOT_BEFORE is used to represent the "nbf" claim- See Also:
- Constant Field Values
-
ISSUED_AT
static final java.lang.String ISSUED_AT
The ISSUED_AT is used to represent the "iat" claim- See Also:
- Constant Field Values
-
ID
static final java.lang.String ID
The ID is used to represent the "jti" claim- See Also:
- Constant Field Values
-
AZP
static final java.lang.String AZP
The AZP is used to represent the "azp" claim- See Also:
- Constant Field Values
-
TOKEN_TYPE
static final java.lang.String TOKEN_TYPE
The TOKEN_TYPE is used to represent the "token_type" claim- See Also:
- Constant Field Values
-
-
Method Detail
-
getIssuer
java.lang.String getIssuer()
- Returns:
- The "iss" claim
-
getSubject
java.lang.String getSubject()
- Returns:
- The "sub" claim
-
getAudience
java.util.List<java.lang.String> getAudience()
- Returns:
- The "aud" claim
-
getExpiration
long getExpiration()
- Returns:
- The "exp" claim
-
getNotBefore
long getNotBefore()
- Returns:
- The "nbf" claim
-
getIssuedAt
long getIssuedAt()
- Returns:
- The "iat" claim
-
getJwtId
java.lang.String getJwtId()
- Returns:
- The "jti" claim
-
getAuthorizedParty
java.lang.String getAuthorizedParty()
- Returns:
- The "azp" claim
-
getClaim
<T> T getClaim(java.lang.String claimName, java.lang.Class<T> requiredType)
- Parameters:
claimName
- claim namerequiredType
- This is the required type of the claim value- Returns:
- The claim value that matches the requiredType
-
getAllClaims
java.util.Map<java.lang.String,java.lang.Object> getAllClaims()
- Returns:
- All the claims
-
toJsonString
java.lang.String toJsonString()
- Returns:
- All the claims in JSON string format
-
-