flipboxfactory / saml-sp

SAML Service Provider (SP) Plugin for Craft CMS
https://saml-sp.flipboxfactory.com/
Other
19 stars 5 forks source link

How does mergeLocalUsers work? #66

Closed thkus closed 4 years ago

thkus commented 4 years ago

Hey!

I have a user that has been created manually in the CP. If i then try to log in using SAML, i'm getting an exception that the email is already taken. Shouldn't mergeLocalUsers check for that and use the User that was found instead of trying to create a new one?

dsmrt commented 4 years ago

👋

This is actually enabled be default. When the user logs into the IdP successfully, if that user isn't the Craft db, the user will be created. When this is false, an error will be thrown, and the user will not be created therefore not being able to log in.

In your case, I think what is happening is, the username coming over from the IdP (the NameID) doesn't match the username in Craft. Can you verify that the username being sent over from the IdP is the same as the one already existing in Craft?

thkus commented 4 years ago

And that was exactly the case. I must have missed the fact, that the username != email. Thanks!