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

Add OIDC_ROLES_MAPPING support #5052

Open
mihaivint opened this issue May 10, 2024 · 0 comments
Open

Add OIDC_ROLES_MAPPING support #5052

mihaivint opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mihaivint
Copy link
Contributor

mihaivint commented May 10, 2024

Mage version

0.9.70 or newer

Describe the bug

Add support for OIDC_ROLES_MAPPING variable to match for examples groups to user roles:

OIDC_ROLES_MAPPING='{"RoleMap-Admin": "Admin", "RoleMap-Editor":"Editor", "RoleMap-Owner":"Owner","RoleMap-Viewer":"Viewer"}'

To reproduce

No response

Expected behavior

No response

Screenshots

No response

Operating system

No response

Additional context

No response

@mihaivint mihaivint added the bug Something isn't working label May 10, 2024
wangxiaoyou1993 pushed a commit that referenced this issue May 14, 2024
# Description
This add support for OIDC_ROLES_MAPPING environment variable:
```
OIDC_ROLES_MAPPING='{"RoleMap-Admin": "Admin", "RoleMap-Editor":"Editor", "RoleMap-Owner":"Owner","RoleMap-Viewer":"Viewer"}'
```
#5052


# How Has This Been Tested?

Using Vault OIDC provider using the following scope template for OIDC
provider:
``` 
SCOPE_TEMPLATE='{
"username": "user",
"email": "test@email.com",
"user_roles":["RoleMap-Admin","RoleMap-Editor"]
}'
```
In case OIDC_ROLES_MAPPING is not defined user_roles remains with normal
behaviour and should look like this:
``` 
SCOPE_TEMPLATE='{
"username": "user",
"email": "test@email.com",
"user_roles":["Admin","Editor"]
}'
```



# Checklist
- [ ] The PR is tagged with proper labels (bug, enhancement, feature,
documentation)
- [ x] I have performed a self-review of my own code
- [ ] I have added unit tests that prove my fix is effective or that my
feature works
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant