Skip to content

feat(auth): discover OIDC authorize and token endpoints - #262

Open
AdamClaassens wants to merge 1 commit into
openclaw:mainfrom
AdamClaassens:feat/oidc-discovery
Open

AdamClaassens wants to merge 1 commit into
openclaw:mainfrom
AdamClaassens:feat/oidc-discovery

Conversation

@AdamClaassens

Copy link
Copy Markdown

ClickClack's OpenClaw ID client currently derives AuthURL/TokenURL as {issuer}/oauth2/authorize and {issuer}/oauth2/token. That matches OpenClaw ID. It does not match Kanidm's OpenID Connect discovery document, where authorization_endpoint is /ui/oauth2 and token_endpoint is /oauth2/token while issuer is /oauth2/openid/:client_id:.

This change GETs <issuer>/.well-known/openid-configuration at serve startup (no redirects), requires the document issuer to match OPENCLAW_ID_ISSUER, and uses the published endpoints. The default OpenClaw ID issuer may still fall back to concatenated paths when discovery is absent. Any other issuer fails closed. Explicit AuthURL and TokenURL skip the fetch.

Tests cover a Kanidm-shaped discovery document, mismatch, missing document, default fallback, and explicit endpoints.

OpenClaw ID still concatenates {issuer}/oauth2/* as the default. Other
issuers, including Kanidm, publish different authorization and token
paths. Fetch OpenID Connect discovery at serve startup and fail closed
when a custom issuer has no usable document.
@AdamClaassens
AdamClaassens requested a review from a team as a code owner September 14, 2026 11:38
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

ClawSweeper will not retry this unchanged revision.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

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