Repository navigation
feat(auth): OIDC sign-in against a deployment-controlled IdP (#95) - #105
Merged
Merged
Conversation
POST /api/auth/oidc exchanges an IdP ID token for a normal session. The token's signature (RS256/ES256 from the IdP's JWKS), issuer, audience and expiry are required and checked; the username claim must name an existing, active local user who is a member of the requested tenant. Nobody is created from claims. JWKS can be https:// or a file:// key file for an enclave; http:// is refused. Off unless OIDC_ISSUER is set, and a half-configured IdP stops startup. Adds PyJWT[crypto] to api/requirements.txt (wheels exist for the offline bundle's CPython 3.12 manylinux target). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YPoXzBSj89ZHgw7nfTmbB
Owner
Author
|
OIDC defaults approved by the product owner on 26 Oct. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #95. Part of ART Milestone 2 (BR-36). ADR-0003 approved OIDC with a local-account fallback.
Flow
{tenant, idToken}toPOST /api/auth/oidc.Defaults I chose (please confirm)
preferred_username(OIDC_USERNAME_CLAIM)emailorupnalso work.noneand HMAC algorithms are refused.https://(fetched, and refetched on an unknown key ID, which handles IdP key rotation) orfile://(a key file published inside an enclave)http://is refused, because keys fetched over plain HTTP could be swapped.exp,iat,iss,audhttp://key URL stops the API at startupNew dependency:
PyJWT[crypto](cryptography). Wheels exist for the offline bundle's target (CPython 3.12, manylinux x86_64), sobuild_bundle.shpicks it up automatically.Evidence
All runs are against local PostgreSQL 16.
scripts/test_report.py --strict)tests/test_oidc.pyscripts/lint.shWhat
tests/test_oidc.pycovers:exp, no username claim,alg: none, and malformed input.Not exercised by these tests: the
https://key fetch. The workspace has no network, so the tests use afile://key file with a locally generated RSA key. Thehttps://path is PyJWT'sPyJWKClient, unchanged. A check against your real IdP (Keycloak or Entra ID) would cover it.Generated by Claude Code