-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Error if user has no role #8958
Comments
We appear to be facing this issue with users recently created via SAML login. |
@isometry happen to have any details about your setup? Specifically doing anything different with db? |
@geekgonecrazy : we're running on a hosted *.rocket.chat instance, so unfortunately have no direct access to the underlying database. SAML is configured to use OneLogin, which provides NameID:=email, cn and username attributes in its assertion. Previously, this correctly matched existing users based on email, and used cn and username attributes only to provision accounts for new users. For the past couple of weeks, it seems that the username attribute has been ignored during provisioning, and instead Rocket creates an account with a blank username. Some of these blank username users (likely the first affected) have a role set (allowing me to set a username manually), but the most recent ones do not, which appears to leave us in the chicket-and-egg dilemma described above. Authentication for existing users continues as expected. |
Parsing our full user list, it appears that with the SAML "Generate Username" setting flipped to "True", new users were created with a non-blank username (seemingly the user part of user@domain.tld, rather than the username attribute passed by SAML) but with no role. |
@isometry please shoot an email to cloud@rocket.chat with your instance name. I can help look into the details there. |
@geekgonecrazy this problem is with empty roles or no roles key in database? With empty roles I got login, with no roles key I could not login and in the log has an exception. If the second one is the problem, I could send a PR. |
@paulovitin It seams to be related with no roles at all (missing the field). |
I should probably spin off another issue. But just remembered also an admin is unable to give a user a role when key doesn't exist or delete the user when roles key doesn't exist. |
I have run into exactly this problem due to the issues described in #18737 I am neither able to add a role nor delete the user. Using the API also fails. |
Using the REST API inside the docker container, I was able to call users.update to manually give them the user role. A call from outside (chat.xy) resulted in a bad request. |
Description:
If some how the user has no role a user cannot login and things break all around for that user.
We should handle this more gracefully
Server Setup Information:
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: