UNPKG

@trimble-oss/trimble-id

Version:

Trimble Identity SDK for JavaScript/ TypeScript

33 lines (29 loc) 1.54 kB
import { ITokenProvider } from "./ITokenProvider" import { IEndpointProvider } from "./IEndpointProvider" /** * @implements {ITokenProvider} * @description The Client Credentials grant is used when applications request an access token to access their own resources. */ declare class ClientCredentialTokenProvider implements ITokenProvider { /** * @description Public constructor for ClientCredentialTokenProvider class * @param {IEndpointProvider} endpointProvider An endpoint provider that provides the URL for the Trimble Identity token endpoint. * It can be OpenIdEndpointProvider/FixedEndpointProvider * @param {string} consumerKey The consumer key for the calling application * @param {string} consumerSecret The consumer secret for the calling application */ constructor(endpointProvider: IEndpointProvider, consumerKey: string, consumerSecret: string); /** * @description Fluent extension to add scopes * @param {IEnumerable<string>} scopes The scopes to add to the token provider */ WithScopes(scopes: string[]): this; /** * @description Retrieves an access token for the application * @returns {PromiseLike<string>} A promise that resolves to the value of the access token on completion * @exception Thrown when a token endpoint is not provided by the endpoint provider * @exception Thrown when a call to the token endpoint fails */ RetrieveToken(): Promise<string>; } export default ClientCredentialTokenProvider