oauth2-proxy: OpenID with Okta provider - using Okta assigned group instead of a user does not pass authentication

We’re trying to see how (and if possible) to configure authentication to our app using Okta groups. When assigning a user directly to the application in Okta all seems to work as expected, but when the user is assigned indirectly via an Okta group we get User is not assigned to the client application error.

Expected Behavior

Oauth2-proxy to infer from the Okta user group membership if he’s a member of a group that is assigned to the Okta application. The flow we first expected to occur is:

  • Is the requested user a member of a group that is currently assigned to the Okta app?
  • If so, he should be able to log in.
  • by reading the user’s Okta groups in the request headers we can set the wanted permissions to the user.

Current Behavior

Getting 403 error and User is not assigned to the client application in logs.

Steps to Reproduce (for bugs)

  1. Create an OpenID Okta app
  2. Create Okta group
  3. Assign the group to the Okta app
  4. Try to log in using a member of that group.

Context

We’re trying to control both authentication and authorization with Okta+oauth2-proxy. Using the groups claim oauth2-proxy is aware of the Okta groups that the user is a member of. So we can control our app authorization by using the groups claim just fine.

However, the only way we managed to pass authentication is by assigning the user directly (not via a group) to the Okta app.

  • This means that we need to manage all users that should be authenticated over the Okta app
  • In addition, we need to assign each user to the proper groups for ACLs and permissions

Your Environment

  1. Nginx in front of oauth2-proxy
  2. config files are taken from here
  • Version used: oauth2-proxy v7.4.0 (built with go1.19.2)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (8 by maintainers)

Most upvoted comments

😦

Following this

Is the error User is not assigned to the client application shown by OAuth2 Proxy, or is it show as part of the Okta dashboard? Can you provide any more detail about where in the flow this occurs?