Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 2.33 KB

clientCredentialsGrant.md

File metadata and controls

48 lines (33 loc) · 2.33 KB

Function: clientCredentialsGrant()

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


▸ clientCredentialsGrant(config, parameters?, options?): Promise<TokenEndpointResponse & TokenEndpointResponseHelpers>

Performs an OAuth 2.0 Client Credentials Grant.

Performs an OAuth 2.0 Client Credentials Grant at the Authorization Server's token endpoint using parameters from the parameters argument

Parameters

Parameter Type Description
config Configuration -
parameters? Record<string, string> | URLSearchParams Additional parameters that will be sent to the token endpoint, typically used for parameters such as scope and a resource (Resource Indicator)
options? DPoPOptions -

Returns

Promise<TokenEndpointResponse & TokenEndpointResponseHelpers>

Example

Requesting an Access Token using the Client Credentials Grant with a scope and a resource (Resource Indicator) parameters.

let config!: client.Configuration
let scope!: string
let resource!: string

let tokenEndpointResponse = await client.clientCredentialsGrant(config, {
  scope,
  resource,
})