Skip to content

Commit af0cda6

Browse files
authored
Merge pull request #6114 from sahandilshan/ciba
Add support for On-Behalf-Of (OBO) tokens in CIBA flow and include re…
2 parents 84e6efd + 1ef86c3 commit af0cda6

6 files changed

Lines changed: 95 additions & 0 deletions

File tree

380 KB
Loading
380 KB
Loading

en/identity-server/next/docs/get-started/about-this-release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Key capabilities include:
3232
- **SMS**: Sends an authentication notification to the user's registered mobile number.
3333
- **External**: Returns an `auth_url` in the backchannel authentication response, delegating notification delivery to the client application.
3434
- Client applications poll the token endpoint using the `auth_req_id` to retrieve access and ID tokens once the user authenticates.
35+
- Issue [On-Behalf-Of (OBO) tokens]({{base_path}}/guides/agentic-ai/ai-agents/agent-authentication/#using-ciba-for-on-behalf-of-delegation) via CIBA by including an `actor_token` in the backchannel authentication request, enabling background AI agents to act on behalf of users.
3536

3637
Learn more about [configuring the CIBA grant]({{base_path}}/guides/authentication/configure-ciba-grant/).
3738

en/includes/guides/agentic-ai/ai-agents/agent-authentication.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,62 @@ As shown in the above sequence diagram, the flow proceeds as follows.
178178

179179
9. **Successful Access**
180180
The request succeeds. The AI agent is now authorized to act on the user’s behalf and access the required resources.
181+
182+
{% if is_version == "next" or product == "asgardeo" %}
183+
184+
### Using CIBA for on-behalf-of delegation
185+
186+
For background agents that operate without direct user interaction, the [CIBA grant]({{base_path}}/guides/authentication/configure-ciba-grant/) can be combined with OBO tokens to enable delegation. Instead of redirecting the user to a browser for consent, the agent initiates a backchannel authentication request with its `actor_token`, and the user approves the delegation asynchronously on a separate device via email, SMS, or an external notification channel.
187+
188+
![Agent OBO via CIBA Flow Diagram](../../../assets/img/guides/agentic-ai/ai-agent-obo-ciba-flow.png)
189+
190+
The flow proceeds as follows:
191+
192+
1. **Backchannel Authentication with Actor Token**
193+
The agent sends a backchannel authentication request to the `/oauth2/ciba` endpoint, including its `actor_token` alongside standard CIBA parameters.
194+
195+
```bash
196+
curl -v -k -X POST {{ api_base_path }}/oauth2/ciba \
197+
--header "Authorization: Basic <Base64Encoded(CLIENT_ID:CLIENT_SECRET)>" \
198+
--header "Content-Type:application/x-www-form-urlencoded" \
199+
--data-urlencode "scope=openid profile" \
200+
--data-urlencode "login_hint=<username>" \
201+
--data-urlencode "binding_message=Agent requesting access on your behalf" \
202+
--data-urlencode "actor_token=<AGENT_ACTOR_TOKEN>"
203+
```
204+
205+
The `actor_token` is a JWT representing the AI agent’s identity, obtained through the agent’s own [authentication flow](#ai-agent-acting-on-its-own).
206+
207+
2. **User Notification and Authentication**
208+
{{ product_name }} validates the actor token and sends a notification to the user through the configured channel (email, SMS, or external). The user authenticates and provides consent on the separate device.
209+
210+
3. **Token Polling**
211+
The agent polls the token endpoint using the `auth_req_id` received in the CIBA response:
212+
213+
```bash
214+
curl -v -k -X POST {{ api_base_path }}/oauth2/token \
215+
--header "Authorization: Basic <Base64Encoded(CLIENT_ID:CLIENT_SECRET)>" \
216+
--header "Content-Type:application/x-www-form-urlencoded" \
217+
--data-urlencode "grant_type=urn:openid:params:grant-type:ciba" \
218+
--data-urlencode "auth_req_id=<AUTH_REQ_ID>"
219+
```
220+
221+
4. **Delegated Token Issuance**
222+
Once the user authenticates, the authorization server issues a delegated access token containing an `act` claim that identifies the agent:
223+
224+
```json
225+
{
226+
"sub": "user@example.com",
227+
"act": {
228+
"sub": "agent-identity@example.com"
229+
},
230+
...
231+
}
232+
```
233+
234+
This token allows the agent to access protected resources on behalf of the user, while resource servers can verify both the user’s identity and the agent acting on their behalf.
235+
236+
!!! note
237+
To use OBO tokens with CIBA, agent identities must be enabled in {{ product_name }}, and the application must have the CIBA grant type enabled. Learn more about [registering background agents]({{base_path}}/guides/agentic-ai/ai-agents/register-and-manage-agents/#registering-an-ai-agent).
238+
239+
{% endif %}

en/includes/guides/authentication/configure-ciba-grant.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,33 @@ Follow the steps given below to test the CIBA flow.
9494

9595
Upon successful execution (and after user authentication is complete), you will receive the requested access and ID tokens.
9696

97+
## Use CIBA with on-behalf-of (OBO) tokens
98+
99+
When [agent identities]({{base_path}}/guides/agentic-ai/ai-agents/register-and-manage-agents/) are enabled, the CIBA grant supports issuing On-Behalf-Of (OBO) tokens. This allows background AI agents to act on behalf of users through the backchannel authentication flow, without requiring browser-based redirects.
100+
101+
To request an OBO token via CIBA, include the agent's `actor_token` parameter in the backchannel authentication request:
102+
103+
```bash
104+
curl -v -k -X POST {{base_url_sample}}/oauth2/ciba \
105+
--header "Authorization: Basic <Base64Encoded(CLIENT_ID:CLIENT_SECRET)>" \
106+
--header "Content-Type:application/x-www-form-urlencoded" \
107+
--data-urlencode "scope=openid profile" \
108+
--data-urlencode "login_hint=admin" \
109+
--data-urlencode "binding_message=Please authenticate to My App" \
110+
--data-urlencode "actor_token=<AGENT_ACTOR_TOKEN>"
111+
```
112+
113+
The `actor_token` is a signed JWT representing the AI agent's identity. When the user authenticates via the notification channel and the client polls the token endpoint, the issued access token will include an `act` claim that identifies the agent acting on behalf of the user:
114+
115+
```json
116+
{
117+
"sub": "user@example.com",
118+
"act": {
119+
"sub": "agent-identity@example.com"
120+
}
121+
}
122+
```
123+
124+
Learn more about [authenticating AI agents on behalf of users]({{base_path}}/guides/agentic-ai/ai-agents/agent-authentication/#using-ciba-for-on-behalf-of-delegation).
125+
97126
Refer to the [CIBA grant reference]({{base_path}}/references/grant-types/#ciba-grant) for more information on how the complete flow works.

en/includes/references/grant-types.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ The diagram below illustrates the CIBA flow.
415415
--data-urlencode "binding_message=<custom_message>"
416416
```
417417

418+
To issue an [on-behalf-of (OBO) token]({{base_path}}/guides/agentic-ai/ai-agents/agent-authentication/#using-ciba-for-on-behalf-of-delegation) for agent delegation, include the `actor_token` parameter:
419+
420+
```bash
421+
--data-urlencode "actor_token=<AGENT_ACTOR_TOKEN>"
422+
```
423+
418424
=== "Sample request (/ciba)"
419425

420426
```bash

0 commit comments

Comments
 (0)