Function: createPendingConsentOnAuthorize()
createPendingConsentOnAuthorize(
__namedParameters): (__namedParameters) =>Promise<OnAuthorizeResult>
Defined in: auth-core/src/pendingConsent.ts:248
Factory for the onAuthorize hook of an OAuth server whose consent screen
lives outside it, holding the authorization request server-side.
Flow:
/authorize(client andredirect_urialready validated) stores a PendingAuthorization and redirects toconsentUrlwith only its opaque id.- The consent screen loads the request with getConsentRequest and,
on approval, calls approveConsentRequest, which records the
subject and returns the
/authorizeURL to resume. - The resumed
/authorizecarries the id and the one-time resume secret the approver received. When the stored request is approved, unexpired, identical to the incoming one and the secret matches, it is consumed (atomically, single use) and approved; otherwise a fresh consent round starts.
Unlike createRedirectConsentOnAuthorize, nothing the consent screen
shows comes from its URL, and an approval is bound to the client,
redirect_uri, scopes and PKCE challenge the user saw, and redeemable only
by the browser that approved.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreatePendingConsentOnAuthorizeOptions |
Returns
(__namedParameters) => Promise<OnAuthorizeResult>