# Table of Contents
Table of Contents
- RefreshableTokenProvider
- ITokenProvider
- RetrieveToken
- IEndpointProvider
- RetrieveAuthorizationEndpoint
- RetrieveTokenEndpoint
- RetrieveUserInfoEndpoint
- RetrieveTokenRevocationEndpoint
- RetrieveJSONWebKeySetEndpoint
- IPersistantStorage
- SetItem
- GetItem
- RemoveItem
RefreshableTokenProvider
The Refresh Token grant type is used by clients to exchange a refresh token for an access token when the access token has expired.
constructor
Public constructor for RefreshableTokenProvider class
Parameters
endpointProviderIEndpointProvider An endpoint provider that provides the URL for the Trimble Identity token endpoint. It can be be OpenIdEndpointProvider/FixedEndpointProviderconsumerKeystring The consumer key for the calling application
WithProofKeyForCodeExchange
Fluent extension for Authorization Code with PKCE
Parameters
codeVerifierstring The PKCE code verifier for the calling application
Returns this
WithConsumerSecret
Fluent extension for Authorization Code with client secret
Parameters
consumerSecretstring The consumer secret for the calling application
Returns this
WithAccessToken
Fluent extension for Authorization Code with access token
Parameters
accessTokenstring The access token for the calling applicationtokenExpirydatetime The access token expiry for the calling application
Returns this
WithIdToken
Fluent extension for Authorization Code with id token
Parameters
idTokenstring The ID token for the calling application
Returns this
WithRefreshToken
Fluent extension for Authorization Code with refresh token
Parameters
refreshTokenstring The refresh token for the calling application
Returns this
WithPersistentStorage
Fluent extension for Authorization Code with persistent storage
Parameters
persistentStorageIPersistentStorage The persistent storage method for the calling application
Returns this
WithLogoutRedirect
Fluent extension to add logout redirect URL
Parameters
logoutRedirectUrlstring
Returns this
RetrieveToken
Retrieves an access token for the authenticated user
- Throws any Thrown when a token endpoint is not provided by the endpoint provider
- Throws any Thrown when a call to the token endpoint fails
Returns PromiseLike<string> A Task that resolves to the value of the access token on completion
RetrieveTokenExpiry
Retrieves an access token expiry for the authenticated user
Returns PromiseLike<string> A Task that resolves to the value of the access token expiry on completion
RetrieveIdToken
Retrieves an ID token for the authenticated user
- Throws any Thrown when a token endpoint is not provided by the endpoint provider
- Throws any Thrown when a call to the token endpoint fails
Returns PromiseLike<string> A Task that resolves to the value of the ID token on completion
RetrieveRefreshToken
Retrieves a refresh token for the authenticated user
- Throws any Thrown when a token endpoint is not provided by the endpoint provider
- Throws any Thrown when a call to the token endpoint fails
Returns PromiseLike<string> A Task that resolves to the value of the refresh token on completion
RevokeRefreshToken
Revokes refresh token for the authenticated user
- Throws any Thrown when a token endpoint is not provided by the endpoint provider
- Throws any Thrown when a call to the token endpoint fails
Returns PromiseLike<void> A Task that revokes the refresh token on completion
GenerateCodeVerifier
Static method to generate a code verifier
Returns string A code verifier string
ITokenProvider
Interface for a token provider
RetrieveToken
Returns PromiseLike<string> A promise that resolves to the value of the token on completion
IEndpointProvider
Interface for an endpoint provider
RetrieveAuthorizationEndpoint
Returns PromiseLike<string> A promise that resolves to the value of the authorization endpoint on completion
RetrieveTokenEndpoint
Returns PromiseLike<string> A promise that resolves to the value of the token endpoint on completion
RetrieveUserInfoEndpoint
Returns PromiseLike<string> A promise that resolves to the value of the user information endpoint on completion
RetrieveTokenRevocationEndpoint
Returns PromiseLike<string> A promise that resolves to the value of the token revocation endpoint on completion
RetrieveJSONWebKeySetEndpoint
Returns PromiseLike<string> A promise that resolves to the value of the JWKS endpoint on completion
IPersistantStorage
Interface for persistant storage
SetItem
Parameters
GetItem
Parameters
keystring The key to retrieve the value from
Returns string The value to stored
RemoveItem
Parameters
keystring The key the value is stored under