-
Notifications
You must be signed in to change notification settings - Fork 117
BE-477: Add Microsoft/Azure AD OIDC SSO provider #8578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| local claims = std.extVar('claims'); | ||
|
|
||
| // Microsoft may provide email via 'email', 'preferred_username', or 'upn' | ||
| local email = | ||
| if "email" in claims && claims.email != "" then claims.email | ||
| else if "preferred_username" in claims && claims.preferred_username != "" then claims.preferred_username | ||
| else if "upn" in claims && claims.upn != "" then claims.upn | ||
| else error "Microsoft OIDC: no email claim found in token"; | ||
|
|
||
| { | ||
| identity: { | ||
| traits: { | ||
| emails: [email], | ||
| }, | ||
| // Microsoft Entra ID verifies directory emails; check email_verified | ||
| // claim if present, otherwise trust the directory. | ||
| verified_addresses: if "email_verified" in claims then ( | ||
| if claims.email_verified then [ | ||
| { value: email, via: "email" }, | ||
| ] else [] | ||
| ) else [ | ||
| { value: email, via: "email" }, | ||
| ], | ||
| }, | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,16 @@ selfservice: | |
| essential: true | ||
| email_verified: | ||
| essential: true | ||
| - id: microsoft | ||
| provider: microsoft | ||
| label: Microsoft | ||
| # Set `client_id` through the `SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_1_CLIENT_ID` environment variable | ||
| # Set `client_secret` through the `SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_1_CLIENT_SECRET` environment variable | ||
| # Set `microsoft_tenant` through the `SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_1_MICROSOFT_TENANT` environment variable | ||
| mapper_url: "file:///etc/config/kratos/hooks/oidc.microsoft.jsonnet" | ||
| scope: | ||
| - profile | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing requested_claims makes email verification check ineffectiveMedium Severity The Microsoft provider in Additional Locations (1) |
||
|
|
||
| flows: | ||
| error: | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.