Asynchronous Authorization - Auth0 Docs

Asynchronous Authorization in Auth0

Asynchronous authorization in Auth0 provides a secure human-in-the-loop mechanism for AI agents. AI agents work autonomously in the background, seeking user consent for sensitive or critical actions only when necessary. This process uses Client-Initiated Backchannel Authentication (CIBA), a decoupled authentication flow where the user provides consent on a trusted device, such as their mobile phone, separate from the device where the agent was initially engaged.

Use cases

AI agents often need to perform actions that are long-running, executed at a later time, or involve sensitive operations. For example:

Asynchronous authorization allows the agent to initiate this request and let the user approve it at their convenience, creating a more seamless and secure user experience. This decoupled mechanism is also ideal for human-in-the-loop interactions, such as approving a stock purchase through a chatbot or completing a financial transaction with a banking agent.

How it works

Auth0 implements asynchronous authorization using the Client-Initiated Backchannel Authentication (CIBA) with Rich Authorization Requests (RAR).

The CIBA flow has the following steps:

  1. Initiation
    The agent’s backend identifies a need for user approval and sends a CIBA request to the Auth0 /bc-authorize endpoint. This request includes a user identifier and the optional RAR payload in the (authorization_details) parameter.

  2. Acknowledgment
    Auth0 immediately acknowledges the request by returning a unique auth_req_id.

  3. Polling
    The agent’s backend uses auth_req_id to begin polling the Auth0 /token endpoint to check for completion.

  4. User consent
    In parallel, Auth0 sends a notification (e.g., push, SMS, or email) to the user’s authentication device, displaying the rich context from the RAR payload. The user approves or denies the request.

  5. Token issuance
    Once the user approves, the next polling request from the agent’s backend to the /token endpoint will succeed. Auth0 returns the required access and ID tokens, allowing the agent to complete the authorized action.

User consent and notification channel selection

When Auth0 receives a backchannel request, it must decide which notification channel to use when requesting user approval. These are the currently available options (in order of preference):

  1. Auth0 Guardian mobile push notification: Sends a mobile push notification to the user’s enrolled mobile device. Authentication and authorization happen in the device that received the notification.
  2. Email: Sends an email to the user’s verified address. The email contains a link and, when selected, authentication and authorization happen in the browser.

By default, Auth0 uses and recommends Guardian push notifications for CIBA flows. Guardian push notifications are more secure than other channels, such as email, which can be vulnerable to phishing attacks. You have to explicitly enable email notifications for CIBA flows.

Email notifications for asynchronous authorization is a paid add-on feature, and is now available for all Essentials, Professional, and Enterprise plans. Please see our pricing page for more details.

To learn more about CIBA notifications, read Configure Client-Initiated Backchannel Authentication.

Get started

To begin using asynchronous authorization in your AI agents, refer to the following resources:

Quickstarts

Asynchronous Authorization

Guides

Configure Rich Authorization Requests (RAR)

Sample Apps

Assistant0: Next.js + Vercel AI SDK](https://github.com/auth0-samples/auth0-assistant0/tree/main/ts-vercel-ai)

Assistant0: Next.js + LangGraph](https://github.com/auth0-samples/auth0-assistant0/tree/main/ts-langchain)

Assistant0: FastAPI + LangGraph](https://github.com/auth0-samples/auth0-assistant0/tree/main/py-langchain)

Assistant0: Next.js + LlamaIndex](https://github.com/auth0-samples/auth0-assistant0/tree/main/ts-llamaindex)

Assistant0: FastAPI + LlamaIndex](https://github.com/auth0-samples/auth0-assistant0/tree/main/py-llamaindex)

Auth0 AI SDK TypeScript samples

Auth0 AI SDK Python samples

Learn more

Client-Initiated Backchannel Authentication Flow

User Authorization with CIBA