Skip to content

feat: Add CIBA grant support - #164

Draft
ikawalec wants to merge 1 commit into
masterfrom
feature/ciba-grant
Draft

ikawalec wants to merge 1 commit into
masterfrom
feature/ciba-grant

Conversation

@ikawalec

@ikawalec ikawalec commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the OpenID Connect CIBA grant (urn:openid:params:grant-type:ciba) in poll mode.

  • Sends a backchannel authentication request to backchannel_authentication_endpoint (read from discovery, including the mTLS alias, or set with --backchannel-authentication-endpoint). The client authenticates the same way as at the token endpoint. Supported parameters: scope, login_hint, id_token_hint, binding_message, acr_values, audience.
  • Polls the token endpoint with auth_req_id until the user approves, retrying on authorization_pending / slow_down.
  • New flags: --backchannel-authentication-endpoint, --binding-message.
  • Interactive prompt asks for the auth method and a login hint for CIBA.
  • The device and CIBA flows now share one polling loop (pollToken). It replaces the device flow's ticker/goroutine and increases the interval by 5s on slow_down (RFC 8628).
  • README: new CIBA section and flags. The example uses placeholders, because the public demo workspace does not have CIBA enabled.

Ping and push delivery modes are not supported; they need a client notification endpoint.

Testing

  • New TestCIBAGrantFlow runs the full flow against an httptest server.
  • Verified manually against a SecureAuth Connect workspace with CIBA (poll) enabled: backchannel request accepted, token issued after approval.
  • TestOAuth2ClientAuthenticationMethods/tls_client_auth fails against the live demo server with "SSL certificate error". It fails the same way on master.

Add urn:openid:params:grant-type:ciba: send a backchannel authentication
request (login_hint/id_token_hint, binding_message, acr_values, audience)
and poll the token endpoint with auth_req_id until the user approves.

The backchannel endpoint is read from discovery (incl. mTLS alias) or set
via --backchannel-authentication-endpoint. Device and CIBA flows now share
one polling loop, which also increases the interval on slow_down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant