goauthentik / goauthentik/authentik

Use id_token for Azure AD Source

Open
#9,871 7 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 1h
Merged PRs (30d)
644

Description

**Is your feature request related to a problem? Please describe.**
The Azure AD source type currently requires the Microsoft Graph API scope User.Read to read the userinfo endpoint. This forbids any other non Graph API scopes to be added which we need (in our case: `XboxLive.signin`).
Microsoft itself recommends using id_tokens for OIDC as long as one doesn't need to retrieve extended user-info from the Graph API: https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#enable-id-tokens

**Describe the solution you'd like**
Azure AD supports id_tokens which contain all claims required for creating an user in Authentik (`preferred_username`, `email` and `name`): https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference

**Describe alternatives you've considered**
No alternatives, as there's no other way to get an access token with different scopes without another user prompt.

**Additional context**
I've already implemented a rough PoC on my own, that still contains some debug logging: https://github.com/silenium-dev/authentik
It works, but I still have to implement tests and properly clean the code.
I'll create a draft pull request for this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.