Skip to content
Workforce IdentityMarkdown

Backchannel authentication

An agent asks its business owner before it acts, the owner answers on their Approvals page, and the agent collects a token for what they approved.

Available, with limitsAPIOpenID CIBA Core 1.0

Some actions shouldn’t happen without a human’s yes: a payment, a deletion, a message sent in someone’s name. Backchannel authentication lets an agent ask for that yes. The request goes to the agent’s business owner, who sees it on their Approvals page and allows or refuses it. If they allow it, the agent gets a short-lived token acting for them, and nothing more.

Use it whenever an agent shouldn’t act without explicit approval, and when the realm answers interaction_required for a scope that needs approval under Agent guardrails. To have the realm hold an ordinary token request until the owner answers instead, see Or the request waits for the owner.

  • Who can do it: a realm administrator (a group holding RealmOwner) turns the grant on and sets the client; RealmViewer can read them. The owner answers as themselves, signed in.
  • Where: today this is set through the API (Call the API shows how to get $CVYUH_SESSION). Owners answer on their Approvals page in the dashboard.
  • First: the agent is registered with a businessOwner (Register an agent).

The agent asks, authenticating as its client, at the realm’s backchannel authentication endpoint, with the scope it wants and a short binding_message for the owner:

Terminal window
curl https://foobar.cvyuh.com/oauth2/bc-authorize \
-d client_id=invoice-agent-client \
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \
-d client_assertion=eyJ… \
-d scope=payments:send \
--data-urlencode "binding_message=Pay invoice 42 to Acme"
{ "auth_req_id": "1c266114-a1be-4252-8ad1-04986c5b9ac1", "expires_in": 300, "interval": 5 }

The owner answers on their Approvals page, where the request shows the agent, its message, the scopes it asks for, and when it expires. The page reads them, as the signed-in owner, from https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/approvals, and answers one by posting { "decision": "allow" } or { "decision": "deny" } to https://foobar.cvyuh.com/api/v0/am/me/v1/oauth2/approvals/<id> (Call the API).

The agent collects its token. In poll mode it asks the token endpoint every interval seconds:

Terminal window
curl https://foobar.cvyuh.com/oauth2/token \
-H "DPoP: <proof>" \
-d grant_type=urn:openid:params:grant-type:ciba \
-d auth_req_id=1c266114-a1be-4252-8ad1-04986c5b9ac1 \
-d client_id=invoice-agent-client \
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \
-d client_assertion=eyJ…

In ping mode the realm calls the client’s notification endpoint once the owner has answered, with the client_notification_token the client sent as its Bearer token, and the client then collects as above.

The token names the owner as sub and the agent in act. To have the owner approve one exact action rather than a scope, send it in authorization_details: see Bounded approvals.

  1. Add urn:openid:params:grant-type:ciba to the realm’s grantTypes (in oauth2Settings) and to the agent’s client’s. Once it’s on, the discovery document publishes backchannel_authentication_endpoint.

  2. Make sure the agent has a businessOwner.

  3. Choose how the agent learns the answer: set the client’s backchannelTokenDeliveryMode to poll, or to ping with a backchannelClientNotificationEndpoint:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/invoice-agent-client \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "backchannelTokenDeliveryMode": "poll" }'

Have an agent ask its owner walks through it, including which scopes need approval for each risk class.

The business owner opens Approvals in the dashboard. Each waiting request shows the agent, its binding message, the scopes it asks for (or the exact action, with Bounded approvals) and when it expires. They choose Allow or Deny. Nothing reaches them by email or push yet, and a request they don’t answer in time expires: the agent is told expired_token and must ask again.

Setting or limitDefaultRange
How long a request waits (cibaLifetimeSecs)300 secondsrequested_expiry can shorten it, never lengthen it
Poll interval (cibaPollIntervalSecs)5 secondsGrows by 5 seconds after each slow_down
Requests waiting for one owner20Fixed
binding_messageRequiredAt most 64 printable characters
Ping retriesOne more try after a timeout or server errorFixed
Refresh tokensNoneEach action needs a new approval
SymptomCauseFix
Requests are never answeredThe owner doesn’t know they’re waiting: no notification is sentTell owners to watch their Approvals page, or notify them from your own system when the agent asks
unauthorized_client at onceThe agent has no business owner, the grant isn’t on for the realm or the client, or a ping client has no notification endpointName the owner; add the grant to both grantTypes; set backchannelClientNotificationEndpoint
Refused at once after many requestsTwenty requests already wait for this ownerHave the owner answer, or let them expire
The owner allowed it, but the agent collects nothingThe agent was quarantined before it collectedRelease the agent; ask again

When the agent collects, the realm writes a TOKEN_ISSUED record with the grant type urn:openid:params:grant-type:ciba: issued and keyed by the owner, with the agent among its principals, or refused (such as access_denied after a Deny) and keyed by the agent’s client. The owner’s answer itself isn’t a record of its own yet; a request never collected leaves none.

  • The owner isn’t notified yet. No email or push message is sent: requests wait on the owner’s Approvals page, so tell owners to watch it.
  • Only an agent’s client may ask, and only for an agent that has a business owner.
  • The business owner is the only approver. A request may name them with one hint, as a check: login_hint by their ID or naming attribute, or id_token_hint with an ID token this realm issued about them, whatever its expiry. A hint naming anyone else is unknown_user_id; login_hint_token is refused. The technical owner never approves, because they may hold far more access than the agent should.
  • Every request carries a binding_message, at most 64 printable characters, which the owner reads to know what they’re approving.
  • An approval brings an access token only. Asking for openid is invalid_scope, and there’s no refresh token: each new action needs a new approval.
  • The agent must still be active both when it asks and when the owner answers. A quarantined agent collects nothing.
  • Each request is answered once, within five minutes by default. requested_expiry can shorten the wait, never lengthen it past the realm’s.
  • At most twenty requests wait for one owner at once. Past that, the agent is refused until some are answered or expire.
  • Polling is paced. A poll inside the interval is told slow_down, and the interval grows by five seconds. A poll that waits the full interval is answered.
  • The token is short-lived. It ends with the session the owner approved from, and lives no longer than the agent’s risk class allows (Agent guardrails).
  • A ping goes only to an https address at a public host. One that times out or meets a server error is tried once more.
WhereSettingWhat it does
Realm and clientgrantTypes include urn:openid:params:grant-type:cibaOff by default
AgentbusinessOwnerWho approves
ClientbackchannelTokenDeliveryModepoll or ping
ClientbackchannelClientNotificationEndpointWhere a ping goes: https, a public host
RealmcibaLifetimeSecs (300), cibaPollIntervalSecs (5)How long a request waits, and the poll pace
ErrorWhen
unauthorized_clientAsking: the client isn’t an agent’s, may not use the grant, its agent has no business owner, or a pinging client has no notification endpoint
invalid_requestAsking: binding_message is missing or too long; more than one hint, a login_hint_token, or an id_token_hint that isn’t this realm’s; a ping client sends no client_notification_token; requested_expiry isn’t a positive number
unknown_user_idAsking: a hint names someone other than the business owner
invalid_scopeAsking: a scope the client may not ask for, or openid
authorization_pending, slow_downCollecting: the owner hasn’t answered yet, or the agent polled too soon
access_deniedCollecting: the owner refused
expired_tokenCollecting: the request ran out before the owner answered