Package com.ibm.cloud.sdk.core.security
Class JsonWebToken.Payload
- java.lang.Object
-
- com.ibm.cloud.sdk.core.security.JsonWebToken.Payload
-
- Enclosing class:
- JsonWebToken
public class JsonWebToken.Payload extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Payload()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAudience()Returns the first "Audience" ("aud") value within this JsonWebToken.java.util.List<java.lang.String>getAudiences()Returns all "Audience" ("aud") values within this JsonWebToken.java.lang.LonggetExpiresAt()Returns the "Expires At" ("exp") value within this JsonWebToken.java.lang.LonggetIssuedAt()Returns the "Issued At" ("iat") value within this JsonWebToken.java.lang.StringgetIssuer()Returns the "Issuer" ("iss") value with this JsonWebToken.java.lang.StringgetRole()Returns the "Role" ("role") value with this JsonWebToken.java.lang.StringgetSubject()Returns the "Subject" ("sub") value with this JsonWebToken.java.lang.StringgetUserId()Returns the "Userid" ("uid") value with this JsonWebToken.java.lang.StringgetUsername()Returns the "Username" ("username") value with this JsonWebToken.
-
-
-
Method Detail
-
getIssuedAt
public java.lang.Long getIssuedAt()
Returns the "Issued At" ("iat") value within this JsonWebToken.- Returns:
- the iat value
-
getExpiresAt
public java.lang.Long getExpiresAt()
Returns the "Expires At" ("exp") value within this JsonWebToken.- Returns:
- the exp value
-
getSubject
public java.lang.String getSubject()
Returns the "Subject" ("sub") value with this JsonWebToken.- Returns:
- the sub value
-
getIssuer
public java.lang.String getIssuer()
Returns the "Issuer" ("iss") value with this JsonWebToken.- Returns:
- the iss value
-
getAudience
public java.lang.String getAudience()
Returns the first "Audience" ("aud") value within this JsonWebToken. Per RFC 7519 §4.1.3, the aud claim may be a string or an array of strings. This method returns the first element for backward compatibility. UsegetAudiences()to retrieve all values.- Returns:
- the first aud value, or null if absent
-
getAudiences
public java.util.List<java.lang.String> getAudiences()
Returns all "Audience" ("aud") values within this JsonWebToken. Per RFC 7519 §4.1.3, the aud claim may be a string or an array of strings; this method always returns a list regardless of the original JSON form.- Returns:
- a list of aud values, or null if absent
-
getUserId
public java.lang.String getUserId()
Returns the "Userid" ("uid") value with this JsonWebToken.- Returns:
- the uid value
-
getUsername
public java.lang.String getUsername()
Returns the "Username" ("username") value with this JsonWebToken.- Returns:
- the username value
-
getRole
public java.lang.String getRole()
Returns the "Role" ("role") value with this JsonWebToken.- Returns:
- the role value
-
-