# Table of Contents
Table of Contents
- ImplicitGrantTokenProvider
- ITokenProvider
- RetrieveToken
- IEndpointProvider
- RetrieveAuthorizationEndpoint
- RetrieveTokenEndpoint
- RetrieveUserInfoEndpoint
- RetrieveTokenRevocationEndpoint
- RetrieveJSONWebKeySetEndpoint
- IClaimsetProvider
- RetrieveClaimset
- IPersistantStorage
- SetItem
- GetItem
- RemoveItem
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
endpointProviderIEndpointProvider An endpoint provider that provides the URL for the Trimble Identity authorization and token endpoints.
It can be be OpenIdEndpointProvider/FixedEndpointProviderconsumerKeystring The consumer key for the calling applicationredirectUrlstring The URL to which Trimble Identity should redirect after successfully authenticating a user
WithScopes
Fluent extension to add scopes
Parameters
scopesIEnumerable<string> The scopes to add to the token provider
Returns this
WithIDTokenValidation
Add ID token validation to an ImplicitGrantTokenProvider
Parameters
persistantStorageIPersistantStorage A store that persists the nonce value during the OAuth redirect workflowclaimsetProviderIClaimsetProvider 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
statestring The state parameter to pass with silent authenticationcallbackstring The callback URL for silent authentication
Returns this
WithLogoutRedirect
Fluent extension to add logout redirect URL
Parameters
logoutRedirectUrlstring
Returns this
GetOAuthRedirect
Get a redirect URL for Trimble Identity
Parameters
statestring 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
hashstring 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
statestring 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
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