Function: pollBackchannelAuthenticationGrant()

August 29, 2025 ยท View on GitHub

๐Ÿ’— 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.


โ–ธ pollBackchannelAuthenticationGrant(config, backchannelAuthenticationResponse, parameters?, options?): Promise<TokenEndpointResponse & TokenEndpointResponseHelpers>

Continuously polls the token endpoint until the end-user finishes the Client-Initiated Backchannel Authentication Grant process

Parameters

ParameterTypeDescription
configConfiguration-
backchannelAuthenticationResponseBackchannelAuthenticationResponseBackchannel Authentication Response obtained from initiateBackchannelAuthentication
parameters?Record<string, string> | URLSearchParamsAdditional parameters that will be sent to the token endpoint, typically used for parameters such as scope and a resource (Resource Indicator)
options?BackchannelAuthenticationGrantPollOptions-

Returns

Promise<TokenEndpointResponse & TokenEndpointResponseHelpers>

Example

let config!: client.Configuration
let scope!: string
let login_hint!: string // one of login_hint, id_token_hint, or login_hint_token parameters must be provided in CIBA

let backchannelAuthenticationResponse =
  await client.initiateBackchannelAuthentication(config, {
    scope,
    login_hint,
  })

// OPTIONAL: If your client is configured with Ping Mode you'd invoke the following after getting the CIBA Ping Callback (its implementation is framework specific and therefore out of scope for openid-client)

let { auth_req_id } = backchannelAuthenticationResponse

let tokenEndpointResponse =
  await client.pollBackchannelAuthenticationGrant(
    config,
    backchannelAuthenticationResponse,
  )