Token
Implements
Index
Constructors
constructor
Returns Token
Properties
readonlyaccessToken
Access token.
readonlycontext
Defines the context this token was issued from.
optionalreadonlydeviceSecret
The Device secret, if requested in scope.
optionalreadonlyexpiresAt
The calculated date at which this object will expire.
readonlyexpiresIn
The expiration duration for this token.
readonlyid
The unique identifier for this token.
optionalreadonlyidToken
The ID token, if requested.
For more information on working with an ID token, see the doc:WorkingWithClaims documentation.
readonlyisExpired
Indicates if this object has expired.
readonlyisRefreshing
Indicates whether or not the token is being refreshed.
readonlyisValid
Indicates if this object is valid.
optionalreadonlyissuedAt
The date this token was issued at.
optionalreadonlyrefreshToken
The refresh token, if requested.
optionalreadonlyscope
The scopes requested when this token was generated.
readonlytokenType
The string type of the token (e.g. Bearer).
staticaccessTokenValidator
The object used to ensure access tokens can be validated against its associated ID token.
staticdeviceSecretValidator
The object used to ensure device secrets are validated against its associated ID token.
staticidTokenValidator
The object used to ensure ID tokens are valid.
Methods
optionaltoken
Return the relevant token string for the given type.
Parameters
kind: TokenType
Type of token string to return
Returns String
Token string, or
nilif this token doesn't contain the requested type.
validate
Validates the claims within this JWT token, to ensure it matches the given
`OAuth2Client`.Parameters
client: OAuth2Client
Client to validate the token's claims against.
optionalcontext: IDTokenValidatorContext
The optional context to use to supply developer-configurable options.
Returns void
staticfrom
Creates a new Token from a refresh token.
Parameters
refreshToken: String
Refresh token string.
client: OAuth2Client
OAuth2Client instance that corresponds to the client configuration initially used to create the refresh token.
Returns Promise<Token>
Resulting Token object created by refreshing.
Token information representing a user's access to a resource server, including access token, refresh token, and other related information.