getAccessToken

Retrieve an access token.


const token = await drupal.getAccessToken(clientIdSecret?: {
clientId,
clientSecret,
url?,
scope?
}): Promise<AccessToken>
  • clientIdSecret
    • Optional
    • If clientIdSecret is not provided, NextDrupal will use the clientId and clientSecret configured in auth.
    • clientId: string: The oauth client id.
    • clientSecret: string: The oauth client secret.
    • url: string: The oauth url. Default: /oauth/token.
    • scope: string

Examples

const accessToken = await drupal.getAccessToken({
clientId: "7034f4db-7151-466f-a711-8384bddb9e60",
clientSecret: "d92Fm^ds",
})