• I am working on a WordPress multisite instance using WP Cassify for authentication, but prior to SSO being set up, the site used local accounts. The email used by the local account is the same that is being passed via SSO, but when a user who has a local account logs in, a new account is created rather than them being logged into the existing account, and the email is not added to the new account (probably because it is already associated with the existing local account). This appears to occur when the local account’s username does not match up with what the username of the account created by SSO authentication is. Is there a way to have WP Cassify connect users to their existing accounts based on email address, or a setting that exists to “merge” accounts? Any help would be appreciated; thank you.

Viewing 1 replies (of 1 total)
  • Salut @aaf017, et merci mille fois pour le plugin ??

    I’ve been working with @chrisbreclaim on their problem. I came up with a simple workaround that involves intercepting the parsed XML response. If I find a WP user whose user_email matches the email sent by CAS, I override the cas_user_name with the proper user_login, and the rest of the authentication process is tricked into thinking that there was a match.

    https://gist.github.com/boonebgorges/f2ad42d0f741c2a075e7d2c0d80f504d

    Obviously, this is not an ideal solution, but it was the best I could do given the location of the filters and actions in the plugin.

    I’d be glad to contribute a more proper fix for the plugin. Do you have a GitHub repo or some other way of accepting a patch?

    Also, I’m unsure whether this sort of logic (first check for user_login matches, then fall back on user_email) is ideal for all CAS integrations, so I could also add a toggle in your settings UI to turn the feature on/off.

Viewing 1 replies (of 1 total)
  • The topic ‘Pre-Existing Local Accounts’ is closed to new replies.