Repository navigation
feat(users): development discovery override and OIDC test issuer for Microsoft sign-in (#879) - #922
Merged
Merged
Conversation
An in-process OpenID Connect issuer (RSA key, JWKS, discovery document, sign(claims)) so modules can test an OIDC sign-in without an IdP. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ycloak recipe (#879) oauth_microsoft_discovery_url (development/testing only) builds a MicrosoftDevOidc that reads endpoints, JWKS and issuer from a discovery document on first use. docs/examples/keycloak-entra-realm.json emits Entra-shaped claims; verified once against the shared dev Keycloak. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
The discovery override fails closed on an unset SM_ENVIRONMENT; discovery URLs must be HTTPS or loopback HTTP; a failed discovery refuses /login with OAUTH_PROVIDER_ERROR instead of a 500; one test signing key per process; README and CHANGELOG shape. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Docs: make dev does not set SM_ENVIRONMENT; env-vars reference notes the fail-closed override; CHANGELOG list spacing. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
ff42c99
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9272a9c5.simple-module-python.pages.dev |
| Branch Preview URL: | https://feat-issue-879-microsoft-dev.simple-module-python.pages.dev |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
oauth_microsoft_discovery_urlpoints Microsoft sign-in at a local IdP through its discovery document.SM_ENVIRONMENTis explicitlydevelopmentortesting. An unset variable doesn't count. Anywhere else it is ignored andusers.oauth.microsoft_discovery_ignoredis logged, so production sign-ins can never be sent to another IdP.MicrosoftDevOidc(users/oauth/microsoft_dev.py):tid, nonce and PKCE rule still applied;/loginrefuses withOAUTH_PROVIDER_ERRORinstead of a 500.simple_module_testgainsOidcTestIssuerand theoidc_test_issuerfixture (RSA key, JWKS, discovery document,sign(claims)), addingPyJWT[crypto]andcryptographyto the testing package. Modules can now test an OpenID Connect sign-in without an IdP.docs/examples/keycloak-entra-realm.jsonis a realm with Entra-shaped claims: a fixedtid, the user id asoid, and the email asupn. The setup steps are indocs/modules/users.md, "Microsoft sign-in without Entra".docs/testing/fixtures.md,docs/reference/env-vars.md,framework/testing/README.md, CHANGELOG.docs/superpowers/specs/2026-11-11-microsoft-dev-idp-design.md.Closes #879
Verification
oid,tidandupnmapped;/login→/callbackround trip throughpytest-httpx;SM_ENVIRONMENTis unset;make lintpasses,make test-pyhas 8456 passed and 28 skipped,make test-jshas 907 passed./login500, and a cached test key.Test plan
PR checkshas actually run and passed.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4