This is probably a question for @Simon_Cossar — I’m having some confusion with missing SSO records, and username issue, for some of our users synced from our WordPress site with WP Discourse.
Somehow we’ve ended up with a bunch of Discourse users with missing SSO records — something like 200+ out of roughly 1500 total users. SSO via WordPress is the ONLY sign-on method we have for Discourse, so seems something has gone wrong.
I suspect this may have something to do with a bulk group import I made.
A little while back I added all our paying subscribers (WordPress users) to a specific group in Discourse, looping through them using the WP Discourse method ‘add_user_to_discourse_group’.
My assumption would be if they didn’t already have an active Discourse account, this would create one linked to their WP account as normal — perhaps that’s not the case? Could this have created Discourse users missing SSO records?
One thing that may be related, and also seems like it could be a bug of some sort — I notice many users with “2” appended to their username in Discourse.
That is, their username in WP is ‘name’ but their username in Discourse somehow got created as ‘name2’. When I search for user ‘name’ in Discourse I don’t see both ‘name’ and ‘name2’ so as far as I can tell it doesn’t seem to be a question of accidental duplicate users, though possible there’s some hidden duplicate logic accidentally triggered on the aforementioned import for whatever reason…
Anyway these users with the extra ‘2’ on their usernames seem to also be among the ones missing SSO records, making me think it’s somehow related.
One other thing, of the ~230 users missing SSO data, I’m seeing ~20 with Discourse status ‘active’ — not even sure how that’s possible, as again, I believe the only way they can log in is via WordPress. (Almost none have posted at all, so seems like it would be safe enough to change their usernames to be the same as the ones in WP…)
Appreciate any thoughts on this. Not urgent (haven’t yet noticed anyone complaining about not being able to log in or anything) but I would like to have correct user data for all our WP users. Would there be some safe way, WP Discourse method or otherwise, to force re-sync SSO records for all users? Thanks!