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:
parent
b4f7782fd8
commit
5d8a2c25ea
3 changed files with 34 additions and 24 deletions
|
|
@ -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"`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue