-
Notifications
You must be signed in to change notification settings - Fork 5
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
Merging user groups seems broken. #205
Comments
First off, You need to have one of these set to true. Figure out which one you can use but this is a BIG security issue if you don't have one set:
Just want to make sure to call this out right away. Looking thru the rest of the description now. |
Going line by line as best as possible here:
You may want to check the project config?
In your event code you are showing, you are overwriting this property here: $event->groupToBeAssigned = [$customerGroup]; //default for customers ... When See how it's being used here: saml-sp/src/services/login/UserGroups.php Lines 190 to 229 in c1991f6
Note the Craft api for
They'll probably only have the customer group right? My technique has been: get existing user groups and merge with the new group I'm setting. I think if you just copied the second user group example in the docs, here, it work by swapping out the I hope this answers your questions. Let me know if you need more clarification. |
This is troubling. I did not set up this config file, a previous dev did. I'll need to test them set to true to see why this was done. As for the rest i will need to dig in a bit and get back to you. Thank you for the advice |
For sure. Feel free to reach out directly for more info. damien at flipbox digital I'll update the docs to be more explicit on the importance of this setting. |
I am using this plugin in a craft 3 instance (we're working on the 4 upgrade) where on the front end, users are signing in via gigya, and for the control panel, we are only allowing users to sign in via okta.
For some reason, I cannot seem to get user groups to behave as expected. I referenced these following links found through GH issues.
And I have the following:
I originally had
defaultGroupAssignments
set to thecustomers
group ID, because we were only using this plugin for front end. This behaves as expected.However upon adding the back end SSO, I removed this and moved the logic into the following:
This almost works as expected, however every time a user logs in via okta, their groups get over-ridden by the groups set here. So if an admin makes an agent also have 1-3 more groups, the next time they log in these groups are removed. This is where I did some digging and found the merge groups config line, however this did nothing for me.
In order to finally get it working as intended, I had to adjust the code to this:
I'm not sure if maybe this was fixed in a later iteration, or we have a buggy situation edge case, or what it is. I did not see anything referencing fixing a group assignment bug when searching the issues.
Craft Version: Craft Pro 3.9.5
PHP version : 7.4.33
Plugin Version: 2.7.5
The text was updated successfully, but these errors were encountered: