oauth2-proxy: [Bug]: Using google groups in Auth endpoint with allowed_groups parameter not working.
Oauth2 Proxy is not handling allowed_groups parameter correctly at Auth endpoint. I got 403 error in my application even if I am a member of google group.
Current Behavior
I was able to configure in Oauth2 Proxy google adminEmail, groups and serviceAccountJson. I used very wide group which includes all employees at my company so when SSO is enabled everyone has an access. This is working correctly and I checked that groups configured at this level of Oauth2 Proxy are correctly verifying if user is member of a google group.
For some applications I would like to narrow access to smaller groups, for example a single team. I am trying to use auth endpoint like this: oauth2/auth?allowed_groups=my-group@company.com. At this point it doesn’t work, it works when I am using parameter allowed_emails with single user e-mails, but when I am trying to use allowed_groups i got 403 error no matter if I am member of defined group or not.
Expected Behavior
I would like to be able to use Google groups like my-group@company.com in Auth endpoint in Ingress annotation. So Oauth2 Proxy expands Google group in to members, compare list of members with user which tries to access application and let in if user is a member of allowed_groups as it works on global configuration level of Oauth2 Proxy.
Possible Solution
It’s possible that I am doing something wrong so wanted clarify some topics:
- Are Google groups handled by
allowed_groupsof auth enpoint? - If yes how I should define such group? I tried by e-mail address and by name and nothing seems to be working. On global configuration level I am using e-mail address of the group and it’s working fine.
- Are there any additional configuration / flags needed in order to make it work? I assumed that if oauth2 proxy is able to handle google groups on global configuration level it will be able to handle it also on auth endpoint.
Steps to Reproduce (for bugs)
In my case:
- setup Oauth2-proxy
- setup Google Auth Provider with “Restrict auth to specific Google groups on your domain” as explained in link: docs
- try to use wide google group on global level
- try to restrict access to smaller group (be member of both wide and small group) on Auth endpoint with
allowed_groupsparameter - you probably should receive 403 error, even though you should have access.
Your Environment
It’s setup in kubernetes. I am having problem only with mentioned feature so I don’t think there is need to analyse my environment.
- Version used: I am using newest app version 7.3 also I needed to use very fresh helm chart in version: 6.2.7 as google groups parameter was just recently added to helm chart: https://github.com/oauth2-proxy/manifests/commit/3b2725dd72a8ebd7cfe7f457f4301be0005239ef
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 7
- Comments: 22 (9 by maintainers)
unstale
still very broken