Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: authorization by checking realm or client specific roles #1162

Closed
lathspell opened this issue Apr 20, 2021 · 6 comments
Closed

Comments

@lathspell
Copy link
Contributor

Expected Behavior

It should be possible to restrict access to certain resources with access control lists that are based on OAuth2 roles.
The roles should be extracted from both, "realm_access.roles" as well as "resource_access.$client.roles".

Current Behavior

Access restrictions are only possible using groups but a common design is that groups are only used inside the OAuth2 server (e.g. Keycloak) for user-management and roles, which are inherited from the groups, are used in the backend apps (oauth2-proxy) to do the actual authorization.

Possible Solution

  • extract roles from realm_access and resource_access
  • implement configuration for access control lists

Maybe have a look at the abandoned Keycloak Gatekeeper. Quoting from its docs at https://github.com/louketo/louketo-proxy/blob/master/docs/user-guide.md:

    --enable-default-deny=true \
    --resources="uri=/admin*|roles=test1,test2" \
    --resources="uri=/backend*|roles=test1" \
    --resources="uri=/css/*|white-listed=true" \
    --resources="uri=/img/*|white-listed=true" \
    --resources="uri=/public/*|white-listed=true"

    By default the roles defined on a resource perform a logical AND so all roles specified must be present in the claims, this behavior can be altered by the require-any-role option however so as long as one role is present the permission is granted.
@NickMeves
Copy link
Member

I think I'm working this here: #1107

Let me know if it covers what you need.

@lathspell
Copy link
Contributor Author

#1107 ("Keycloak OIDC Provider") has a title that is a bit unspecific. Somewhere in the comments extracting roles and turning them into oauth2-proxy groups is mentioned, though.

Still, extracting JWT roles into OAuth2-Proxy "Groups" only solves half the problem. The other half is that the Gatekeeper example above lets you set different ACLs for different wildcard-paths.

Having this feature would make migrating from Keycloak/Louketo Gatekeeper zu OAuth2-Proxy much easier.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

@github-actions github-actions bot added the Stale label Jul 17, 2021
@lathspell
Copy link
Contributor Author

github-actions bot: please don't close this!

@JoelSpeed JoelSpeed removed the Stale label Jul 19, 2021
@evgenstein
Copy link

it's the same - #1360

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants