Skip to content

# Table of Contents

Table of Contents

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

  • endpointProvider IEndpointProvider An endpoint provider that provides the URL for the Trimble Identity token endpoint. It can be be OpenIdEndpointProvider/FixedEndpointProvider
  • consumerKey string The consumer key for the calling application

WithProofKeyForCodeExchange

Fluent extension for Authorization Code with PKCE

Parameters

  • codeVerifier string The PKCE code verifier for the calling application

Returns this

WithConsumerSecret

Fluent extension for Authorization Code with client secret

Parameters

  • consumerSecret string The consumer secret for the calling application

Returns this

WithAccessToken

Fluent extension for Authorization Code with access token

Parameters

  • accessToken string The access token for the calling application
  • tokenExpiry datetime The access token expiry for the calling application

Returns this

WithIdToken

Fluent extension for Authorization Code with id token

Parameters

  • idToken string The ID token for the calling application

Returns this

WithRefreshToken

Fluent extension for Authorization Code with refresh token

Parameters

  • refreshToken string The refresh token for the calling application

Returns this

WithPersistentStorage

Fluent extension for Authorization Code with persistent storage

Parameters

  • persistentStorage IPersistentStorage The persistent storage method for the calling application

Returns this

WithLogoutRedirect

Fluent extension to add logout redirect URL

Parameters

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

  • key string The key to store the value under
  • value string The value to store

GetItem

Parameters

  • key string The key to retrieve the value from

Returns string The value to stored

RemoveItem

Parameters

  • key string The key the value is stored under