How to handle user email changes in wordpress / sso / wp-discourse plugin


(Leah Kramer) #1

Hello all. We’re experimenting with wordpress + discourse + wp-discourse plugin with all the sso settings set.

We’re aiming to have all account creation happen only in wordpress and to have users login to wordpress and then be automatically logged into discourse via sso when they visit our discourse site.

This is working fine for a simple test case scenario.

But if I go and change my email address in wordpress, then I can’t login to discourse via sso anymore. Is there some setting somewhere that I may have missed which makes the system be able to handle email address changes?


(Simon Cossar) #2

When I try this, I am still able to log in to Discourse with SSO when I change my email address in WordPress.


(Leah Kramer) #3

If you logout after changing your email address and then login back into wordpress and then try to get into discourse via sso does it still work?


(Simon Cossar) #4

Yes it still works. Are you testing this in a local development environment? What browser are you using?


(Leah Kramer) #5

Thanks so much for the reply here and over on the other thread I started today.

I’m working a live staging environment and so far I’ve done my tests on Safari Mac.

I worry that I may not have filled out all the sso-related settings quite the way I need to. Especially since I’m also also having the problem I mentioned here where I need to refresh discourse to show as logged in.

Would you be willing to share exactly how you set things up? Like perhaps share a screen grab of your Admin/Settings/Login screen in Discourse and the settings screen for the wp-discourse plugin?

I made my best guess for each setting but I think I might have guessed wrong in a place or two.


(Simon Cossar) #6

Maybe there’s something here:

What WordPress theme are you using?
Are you using a plugin to add a login form to the site?
On your WordPress site, if you log out and then go to yourdomain.com/login what page on your site are you redirected to? On a standard WordPress install you will be directed to yourdomain.com/wp-login.php.


(Steven Greco) #7

If you do not have the sso overrides email option checked it will not update the email on discourse causing it to not log in. Also you need to make sure that the setting in Discourse “email editable - Allow users to change their e-mail address after registration” is checked. I think it is by default but probably good to check and make sure.


(Leah Kramer) #8

Seems like this may be working better now. I think checking this option:

“Overrides local email with external site email from SSO payload on every login, and prevent local changes.”

causes the newly changed email address to be copied into discourse the next time the person logs in.

Thanks for all the replies!


(Simon Cossar) #9

That’s what I thought, but at least on my local setup, without selecting those options I can still log into Discourse after changing my WordPress email address. Selecting the ‘sso_overrides_email’ option just makes it so that the user’s Discourse email address is updated if they change it on WordPress.