Unable to get "Automatic team membership" to work with Microsoft OAuth #12392
Unanswered
liquid-metal
asked this question in
Help
Replies: 1 comment 1 reply
-
Hey, just to clarify, you are trying to map Entra ID groups to Portainer teams via MS OAuth? For the “Claim Value Regex” section, you need to input the Object ID of the group. You can find this in the group’s properties in Entra ID. Then, in Portainer, map it to the corresponding Portainer team of your choice. If you’ve tried this and it’s not working, let me know, and we can dig deeper into the issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ask a Question!
License: free 3 node business
Setup: Docker standalone (compose), traffic goes through a forward proxy that is specified with HTTP_PROXY/HTTPS_PROXY env vars
Version: 2.21.4 BE
I have successfully configured Microsoft OAuth - Authentication is possible. Unfortunately, the "Automatic team membership" option does not what I want/expect, and I am missing any more places to look for hints.
My ultimate goal would be to map Entra ID groups to portainer teams (ideally 1-to-many relation, but 1-to-1 would be sufficient).
For the required claim name, I'd expect that to be a field out of the OIDC ID Token: https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference. The comment in https://github.com/orgs/portainer/discussions/11964 suggests that my guess about usage of the ID token is correct, and the access token claims are not available.
Unfortunately
(a) the ID token seems to not contain a claim that specifically includes information about user groups (but that is obviously not a portainer problem)
(b) I have the suspicion that portainer does not apply the claim name, even after container deletion & recreation
For the (b) suspicion, I enabled portainer debug logs (--log-level=DEBUG), and right after the OAuth login, a debug line in the log output of the container states:
DBG github.com/portainer/portainer-ee/api/oauth/oauth_resource.go:68 > failed to find group claim in resource
even though I specified my claim name to be "roles" - and suspiciously enough, "group" is the suggested default value if nothing is entered into the text field
As the OAuth provider configuration has a "Resource URL" that is technically able to provide portainer with information about the user groups (using all MS defaults), that gives me hope that the behavior I want is possible, but maybe not obvious how to achieve.
Two specific questions
Further, any hint towards where to look/dump/whatever are obviously welcome.
And also, if anybody has a working setup that maps Entra ID groups to portainer teams, any hint is appreciated
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions