-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
OAuth users are automatically assigned with user role #14454
Comments
For the 2nd connection with OAuth service, user looses the "user" role. So it seems to be related to the user creation process. |
@magicbelette I think this PR should solve the problem. |
Unfortunately, new users still have "user" role after patching my instance.
|
@magicbelette What OAuth service are you using? |
A custom one |
Is the setting |
Yes you're right. If I set Maybe I'm not doing it the right way. I need a specific role ("guest") for users coming from OAtuh service. This role must not create channel, group or direct message. Other users (LDAP auth) have the default role "user". Thx for your help |
@magicbelette Can we close this? |
Sorry but it isn't clear for me... |
@magicbelette yes, if you need assign roles to users coming from Oauth services, you can set in this fields. |
Ok, to sum up, "Default roles for authentication services" is set to "user". So, all my LDAP users inherit "user" role, that's what I want. By adding an OAuth service with "roles/groups field name" set (OAuth send me "guest") :
I don't figured out if there's some kind of bug or if I misunderstood the "Merge role from SSO" option. Maybe the solution will come from this PR to separate roles given for LDAP and OAuth ? |
Reading what you have detailed now, I think the PR that separate roles should solve your problem. What do you think? |
Unfortunately not, cause the PR that separate roles implies that all of my 90K users belongs to the same LDAP group. I think that the problem is with this PR.
|
I think this might be key... this user role is getting set from here for all services, not just ldap |
Sure, but the option "Merge role from SSO: false" must override the "Default roles for authentication services" or I don't understand the point to keep this option. |
I've just found that roles other than the ones coming from OAuth service are correctly removed for the second connection by this method updateRolesFromSSO() in oauth_helpers.js :
The problem is that this method is called before the user's creation instead of being called after user's creation. Any idea on how to (nicely) solve this ? |
Any idea @rodrigok ? |
Description:
Users coming from OAuth service get "guest" role thanks to #5842 but seems that since version 1.0.3, "user" role is also added
Steps to reproduce:
Expected behavior:
Only role from OAuth mapping should stay
Actual behavior:
User has role from OAuth mapping + "user" role
Server Setup Information:
Additional context
Maybe linked to #13823 ?
The text was updated successfully, but these errors were encountered: