メインコンテンツへスキップ
Client-Initiated Backchannel Authentication (CIBA) is an specification that allows a client application to initiate an authentication and/or without requiring direct user interaction on the initiating application. Rich Authorization Requests (RAR) is an OAuth 2.0 extension that allows client applications to request for more complex permissions beyond standard OAuth 2.0 scopes in an authorization request. You can use CIBA with RAR to pass data to the in a backchannel request. The authorization_details parameter contains details about the request that you can customize in a consent prompt to show the user.

Common use cases

Use RAR with the CIBA flow for use cases that require more fine-grained control over resource access. Common use cases include:
  1. A payments app prompts the user to confirm a money transfer. The authorization_details can be customized to show the transaction details.
  2. An AI agent prompts the user with details about a rescheduled doctor’s appointment. The authorization_details can be customized to show the new time and date.

How it works

The User Authorization with CIBA flow is similar to the User Authentication with CIBA flow, where RAR support enables clients to pass the authorization_details to the authorization server via the /bc-authorize endpoint. The following sequence diagram explains the end-to-end User Authorization with CIBA flow:
The sequence diagram defines two actors: an authorizing user and an initiating user. The authorizing and initiating user can be two different entities, such as an AI agent performing a task on a user’s behalf. In other use cases, they can be the same entity, such as a user authorizing a transaction on a retail kiosk or another connected device.

Prerequisites

To initiate a CIBA push request using Auth0, you must complete the following prerequisites:
If you have set as always required for your tenant, users are prompted to enroll for MFA at their next login. You can also use Actions to prompt for MFA enrollment.

Step 1: Client application initiates a CIBA request

Use the User Search APIs to find the authorizing user for whom you’d like to initiate a CIBA request and obtain their user ID. Once you have a user ID for the authorizing user, use the Authentication API to send a CIBA request with the authorization_details to the /bc-authorize endpoint:

Step 2: Auth0 tenant acknowledges the CIBA request

If the Auth0 tenant successfully receives the POST request, you should receive a response containing an auth-req-id that references the request:
The auth_req_id value is passed to the /token endpoint to poll for the completion of the CIBA flow.

Step 3: Client application polls for a response

Use the Authentication API to call the /token endpoint using the urn:openid:params:grant-type:ciba grant type and the auth_req_id you received from the /bc-authorize endpoint:
Until the authorizing user approves the transaction, you should receive the following response:
The polling interval is determined by the interval value received in the response from the /bc-authorize endpoint. If you poll too frequently, you will receive the following response, where the description varies depending on the backoff interval:
You can inspect the Retry-After response header to determine the next wait interval (in seconds). To resolve the error, wait until the next interval to poll the /token endpoint.

Step 4: Mobile application receives the push notification

Auth0 sends a push notification to the user’s registered mobile app or device. The Guardian SDK provides methods to parse the data received from the push notification and return a ready-to-use Notification instance. The Notification instance includes a transaction linking ID, or txlinkid, that the mobile application uses to retrieve the consent details from Auth0. The following code samples are example iOS and Android mobile push notification implementations using the Guardian SDK:
Call the Guardian SDK from your mobile application to retrieve the consent details i.e. the contents of the binding_message from the Auth0 Consent API. The following code samples are example iOS and Android implementations that retrieve data from the Auth0 Consent API:
The Auth0 Consent API responds to the mobile application with the consent details, including the binding_message, scope, audience, and authorization_details if configured. The scopes returned to the mobile application are filtered according to your RBAC policy. To learn more, read Role-Based Access Control. The following code sample is an example response from the Auth0 Consent API:
The mobile application presents the authorization request and/or the consent details with the authorization_details to the user in a push notification via the Guardian SDK. The user can accept or decline the authorization request at this point.

Step 7: Mobile application sends the user response back to Auth0

Depending on whether the user accepts or rejects the authorization request, the mobile application sends the user response back to Auth0. The following code samples are example iOS and Android implementations that handle the user response:

User accepts the authorization request

User rejects the authorization request

Step 8: Auth0 receives user response after the flow completes

The client application completes the polling upon receiving a response from the /token endpoint. A CIBA flow always requires a response, either an approval or decline, from the authorizing user, and existing grants are not checked. This means Auth0 treats every CIBA request as a fresh authorization for the authorizing user.

Step 9: Auth0 returns access token to client application

If the user rejects the push request, Auth0 returns an error response like the following to the client application:
If the user approves the push request, Auth0 returns an with the authorization_details like the following to the client application:
Note: The id_token will only be present if the openid scope was included in the initial /bc-authorize request.

Query authorization_details

At compile time, you can query the type and objects of authorization_details from the consent details in a strongly typed manner as you would dynamically query JSON:
If you define a custom type to represent your object, you can use the filterAuthorizationDetailsByType() function to return all authorization_details objects that match the desired type. The following code sample queries authorization_details with the payment type:
filterAuthorizationDetailsByType() only returns objects matching the specified authorization_details type. As a result, your mobile application should present all relevant authorization_details to the user for consent, regardless of their type, to ensure a complete understanding of the request You can also query the authorization_details when the AI agent or application polls the /oauth/tokenendpoint for a response:
When the authorizing user approves the request, Auth0 receives the user response, and the CIBA flow completes, returning an access token and authorization_details array:

Limitations

Auth0 doesn’t support:
  • Accessing or modifying RAR in Actions for CIBA flows.
  • Advertising RAR types for clients to discover, which means you need to pre-register clients with the authorization_details types they can send.
  • Validating RAR objects beyond checking that they have a type property that matches allowed types for the API. Your resource server is responsible for the granular validation of the content within authorization_details. For more information, see Configure RAR.

もっと詳しく