mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[OIDC] Allowed_groups directive issue #403
Closed
opened 2025-12-29 01:28:19 +01:00 by adam
·
23 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#403
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yaroslavkasatikov on GitHub (Jan 3, 2023).
Hey team,
I faced with the issue while testing new
allowed_groupsdirective.I have tried to use it with auth0 and Keycloak, but received
unauthorized principal (allowed groups)and an error in Headscale log.My oidc config in config.yaml:
Keycloak version:
auth0.com Version:
Some screnshots from Keycloak and auth0:
@yaroslavkasatikov commented on GitHub (Jan 6, 2023):
Tried to upgrade up to beta3, but the same issue.
Also got sometime SIGSEGV on container start:
@madjam002 commented on GitHub (Feb 14, 2023):
This is not a bug and rather a configuration issue.
The following works for Keycloak (tested as of version 20.0.3):
allow_access)groups, make sure add to ID token is checked(or whatever the name of your role is)
Your headscale config can then be e.g:
No need for the leading slash.
@almereyda commented on GitHub (Sep 13, 2023):
@yaroslavkasatikov Does the aforementionned workaround for the perceived issue work for you?
Maybe this could be closed, then.
@LEI commented on GitHub (Oct 7, 2023):
I was facing the same error with Authentik, creating a group bind policy had no effect.
Removing the leading slash seems to be the solution, maybe the basic configuration example could be updated in the documentation.
@NiklasRosenstein commented on GitHub (Oct 18, 2023):
@LEI Could you explain a little how you got it working with Authentik?
@NiklasRosenstein commented on GitHub (Oct 19, 2023):
@madjam002 Thanks for this, it worked! After some more investigating, I found it a bit easier to set it up with a "group membership mapper".
And you can turn off "Full group path" off to remove the leading
/from the group name in thegroupsclaim.As that may be helpful to some as well, the Terraform code I'm using to create this configuration is:
@SirBomble commented on GitHub (Nov 6, 2023):
@LEI I too would be curious to see how you got groups working with authentik
@LEI commented on GitHub (Nov 6, 2023):
To get it working I changed the issuer and removed the leading slash from the configuration:
OIDC authentication required the scope mapping to be correctly defined, the group part is relatively simple:
@kfkawalec commented on GitHub (Dec 14, 2023):
Any example of configuration on Azure AD?
I am configuring the integration based on
https://headscale.net/oidc/#azure-ad-example
And there is the same error: "Unauthorised principal (allowed groups)"
Without "allowed_groups" it works. But I want groups.
I tried with "/" and without.
@deepbluemussel commented on GitHub (Jan 9, 2024):
Same issue with Azure AD. Doesn't seems to be working with it for the moment.
@github-actions[bot] commented on GitHub (Apr 9, 2024):
This issue is stale because it has been open for 90 days with no activity.
@github-actions[bot] commented on GitHub (Apr 16, 2024):
This issue was closed because it has been inactive for 14 days since being marked as stale.
@javito1081 commented on GitHub (Apr 22, 2025):
i know this is from last year but im using Authentik and i still cant make the groups work, i created the group but all users despite being inside that group or not are still able to log in, any advices?
@LEI what do u mean by "OIDC authentication required the scope mapping to be correctly defined, the group part is relatively simple:" where did u change that or what did u do to make the groups work?
@LEI commented on GitHub (Apr 22, 2025):
@javito1081 from what I can recall, the "oidc.scope" property of Headscale should match the scope mapping configured in Authentik (email, openid, profile).
@javito1081 commented on GitHub (Apr 22, 2025):
Oh ya i got that part done, i mean my instance is working fine, OIDC is working fine as well, what im trying to setup is the allowed groups part, i setup a group in there but its not being recognice by headscale or idk whats happening because ppl that r not in the group r able to log in without issues
You mention something in ur post about fixing it, thats why i was asking on how u did it cause i didnt understand the solution u gave when u said this
@LEI commented on GitHub (Apr 26, 2025):
The intial issue is about the error
authenticated principal not in any allowed groupswhich happens to all users when groups are misconfigured I believe. The doc example has a comment about Keycloak:Removing the leading slash seems to fix it for a properly configured Authentik:
@javito1081 commented on GitHub (Apr 26, 2025):
Would it be so much if I ask how u setup the groups in authentik?
@LEI commented on GitHub (Apr 26, 2025):
I assigned the default "authentik Admins" and the newly created "headscale" group to the example user as described in the HCL snippet. Every property in resources like "authentik_provider_oauth2" should match a field in the UI.
@javito1081 commented on GitHub (Apr 26, 2025):
pardon my lostness, but what HCL snippet? :-(
@LEI commented on GitHub (Apr 26, 2025):
It's a syntax to define configuration , this part is creating an user and the "headscale" group:
You can see the full file in this https://github.com/juanfont/headscale/issues/1114#issuecomment-1795922761.
@javito1081 commented on GitHub (Apr 26, 2025):
that file! that is the file, where can i find that file on my authentik instalation?
@LEI commented on GitHub (Apr 26, 2025):
@javito1081 that's an abstraction of the configuration provided by Terraform/OpenTofu, I don't know if Authentik has a configuration file that can be shared, and I don't have access to the installation right now.
I used this format instead of screenshots because it might be easier to see the full picture. If you are configuring Authentik manually you might find the equivalent steps in the corresponding documentation, for example to manage groups: https://docs.goauthentik.io/docs/users-sources/groups/manage_groups
@luochen1990 commented on GitHub (May 1, 2025):
So, the
allowed_groupsfield is actuallyallowed_roles? should we rename it toallowed_roles?