mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-09 21:49:39 -05:00
OIDC: Query userinfo endpoint before verifying user
This patch includes some changes to the OIDC integration in particular: - Make sure that userinfo claims are queried *before* comparing the user with the configured allowed groups, email and email domain. - Update user with group claim from the userinfo endpoint which is required for allowed groups to work correctly. This is essentially a continuation of #2545. - Let userinfo claims take precedence over id token claims. With these changes I have verified that Headscale works as expected together with Authelia without the documented escape hatch [0], i.e. everything works even if the id token only contain the iss and sub claims. [0]: https://www.authelia.com/integration/openid-connect/headscale/#configuration-escape-hatch
This commit is contained in:
@@ -310,6 +310,7 @@ type OIDCUserInfo struct {
|
||||
PreferredUsername string `json:"preferred_username"`
|
||||
Email string `json:"email"`
|
||||
EmailVerified FlexibleBoolean `json:"email_verified,omitempty"`
|
||||
Groups []string `json:"groups"`
|
||||
Picture string `json:"picture"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user