SSO, WP Discourse and special characters in username

This weekend I set up WP Discourse to bring in anyone that makes a WooCommerce purchase in as a Discourse user. I got everything to work and was super proud of myself and even set up Zapier to add them automatically to a group. But this morning someone named François made a purchase and they did not get added as a Discourse user.

I tested to make sure Chris Smith still worked. Yes.

I tested to see if Chrisç Smith would work. It doesn’t. So the c with a squiggle is causing the problem.

The user was added as a Wordpress user with a username using a normal c without a squiggle. They were not added to Discourse.

Can this be fixed or should I add them to Discourse manually? If I add them manually will their logins sync between WP and Discourse?

1 Like

Are you making the request to add the user to Discourse from WordPress or from Zapier?

For SSO, is it configured so that users log into Discourse through WordPress, or are users logging into WordPress through Discourse?

2 Likes

With the Wp-Discourse SSO. Zapier was just to add them to the group.

Users log into Discourse through Wordpress. I think I’m saying that correctly. Wordpress is the SSO provider.

2 Likes

With SSO disabled, I am able to create a Discourse account with François as a username. I am not able to create a WordPress account with that username. The error message I get on WordPress is “This username is invalid because it uses illegal characters. Please enter a valid username.”

Are you using a plugin on your WordPress site to allow for additional characters in usernames?

2 Likes

I’m not using any special plugins to allow additional characters, but it did create a username for this person, just without using the special character. francois.xxx. Something changed the ç to c.

I am using WooCommerce and it’s in the WooCommerce checkout page that they enter their user info to create a login. I am requiring them to create a login.

1 Like

It sounds Woocommerce strip unallowed characters from the username. Is the user with the francois.xxx username able to login to Discourse? Logging into Discourse should create an account for them.

1 Like

I don’t know if they can. I don’t really want to put a new customer through that testing, but I’ll try it with my chrisç username and see what I can do. I do know that they are not being added to my user list in Discourse when they have that character in them.

Thank you for all of your help!

You can try creating an account with a throw-away gmail address for testing this.

If you enable the “Create or Sync Discourse Users on Login” setting on the WP Discourse SSO Provider tab, Discourse accounts should be automatically created for WordPress users when the user logs into WordPress.

If you are adding users to Discourse groups via Zapier, the request will fail if the user doesn’t exist on Discourse yet. The best way to avoid issue with this would be to add users to groups with SSO. Setting this up is somewhat technical though: Managing Discourse group membership with WP Discourse.

1 Like

That’s exactly what I did and it does work.

That’s what I figured. It’s not a huge deal. I can add the few people with issues manually.

I’ve tried to stay away from the technical stuff, but may give your suggestion a try.

Did I tell you that I love Discourse? Thank you for everything and thanks for all of the help today!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.