Skip to content

# Table of Contents

Table of Contents

ImplicitGrantTokenProvider

In the Implicit Grant flow, Application gets an access token directly without an intermediate code exchange step.

constructor

Public constructor for ImplicitGrantTokenProvider class

Parameters

  • endpointProvider IEndpointProvider An endpoint provider that provides the URL for the Trimble Identity authorization and token endpoints.
    It can be be OpenIdEndpointProvider/FixedEndpointProvider
  • consumerKey string The consumer key for the calling application
  • redirectUrl string The URL to which Trimble Identity should redirect after successfully authenticating a user

WithScopes

Fluent extension to add scopes

Parameters

  • scopes IEnumerable<string> The scopes to add to the token provider

Returns this

WithIDTokenValidation

Add ID token validation to an ImplicitGrantTokenProvider

Parameters

  • persistantStorage IPersistantStorage A store that persists the nonce value during the OAuth redirect workflow
  • claimsetProvider IClaimsetProvider A claimset provider that returns the JSON web keyset for validating the JWT ID token

Returns this

WithSilentAuthentication

Add silent authentication to an ImplicitGrantTokenProvider

Parameters

  • state string The state parameter to pass with silent authentication
  • callback string The callback URL for silent authentication

Returns this

WithLogoutRedirect

Fluent extension to add logout redirect URL

Parameters

Returns this

GetOAuthRedirect

Get a redirect URL for Trimble Identity

Parameters

  • state string An optional state parameter that will be passed back to the caller via the redirect URL
  • Throws any Thrown when an authorization endpoint is not provided by the endpoint provider

Returns PromiseLike<string> An awaitable Task that resolves to the redirect URL

DecodeHash

Validate the hash parameters passed back to the application by Trimble Identity

Parameters

  • hash string The hash string from the URL
  • 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> An awaitable Task

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

RevokeToken

Revoke the token for the authenticated user and return a redirect URL to log them out of all Trimble Identity applications

  • Throws any Thrown when a token revocation endpoint is not provided by the endpoint provider
  • Throws any Thrown when a call to the token revocation endpoint fails

Returns PromiseLike<string> A Task that resolves to the value of the redirect URL on completion

GetOAuthLogoutRedirect

Return a redirect URL to log out of all Trimble Identity applications

Parameters

  • state string An optional state parameter that will be passed back to the caller via the redirect URL

Returns PromiseLike<string> A promise that resolves to the value of the redirect URL on completion

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

IClaimsetProvider

Interface for a claimset provider

RetrieveClaimset

Returns PromiseLike<any> A promise that resolves to the value of the claimset 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