SU-SWS / stanford_ssp

Drupal module for configuring SimpleSAMLphp in Stanford web environments
GNU General Public License v2.0
9 stars 8 forks source link

SITES-676: Prevent duplicate values when creating new user. #47

Closed sherakama closed 6 years ago

sherakama commented 6 years ago

READY FOR REVIEW

Summary

Needed By (Date)

Urgency

Steps to Test

  1. Spin up a site on the 7.x-2.x branch of this module
  2. Log in and try to create a local user and a SSO user. Get error on both.
  3. Check out this branch.
  4. Repeat step 2 but with success

Associated Issues and/or People

See Also

jbickar commented 6 years ago

So does this only happen when the user's canonical SUNetID is different from their email address? That would 'splain a lot.

jbickar commented 6 years ago

Also, if that's the case, I cannot test this. But I know someone who can...

sherakama commented 6 years ago

No, this has to do with the response from the SAML request. In the response that I had previously used the key for the email address was email but in the new set up it is simply mail. The validation code was not able to do an accurate match as the key was missing. Having a different email from sunet shouldn't affect this but is worth testing to be sure.

jbickar commented 6 years ago

OK, I'll have to look closer to see why it was getting a duplicate user error for the active $user, not the user being added.

sherakama commented 6 years ago

In order to have the 'auto register' functionality working we use hook_user_insert() which, on any user creation, checks to see if it needs to be a SAML user. This code was not able to identify that the current user was not the new user as the key in the SAML attributes array was different.

codeclimate[bot] commented 6 years ago

Code Climate has analyzed commit a2dac0f8 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1

View more on Code Climate.