Skip to content

Conversation

@fredrikekre
Copy link
Contributor

@fredrikekre fredrikekre commented Jun 27, 2025

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 oidc: try to get username from userinfo #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.

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

@nblock
Copy link
Collaborator

nblock commented Aug 10, 2025

Could you please rebase and fix the conflict for the CHANGELOG?

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 juanfont#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
@fredrikekre
Copy link
Contributor Author

Done!

@nblock nblock enabled auto-merge (rebase) August 11, 2025 15:46
@nblock nblock merged commit 5d8a2c2 into juanfont:main Aug 11, 2025
81 of 84 checks passed
@fredrikekre fredrikekre deleted the fe/userinfo-groups branch August 11, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants