SSO redirect fails for non latin chars


#1

Enabling Discourse as SSO provider (in wordpress but that is unrelated) doesn’t work when setting the redirect paramenter to non-latin chars. for example this works:

https://www.my_wordpress_website.com/?discourse_sso=1&redirect_to=https://www.my_wordpress_website.com/AAAA/

but this doesn’t work:

https://www.my_wordpress_website.com/? discourse_sso=1&redirect_to=https://www.my_wordpress_website.com/אאאא/

by “doesn’t work” i mean that the bad url just redirects to an “Oops error page” in Discourse


(Jeff Atwood) #2

Use the transliterated URL characters instead. I wouldn’t expect unicode to work in that field.

https://www.my_wordpress_website.com/%D7%90%D7%90%D7%90%D7%90/


#3

Thanks, but Wordpress creates that url via this discourse plugin shortcode [discourse_sso_client login=‘Login here’ ]
The redirect URL is automatically set to the page in which the shortcode was embedded.


(Simon Cossar) #4

You can add a redirect parameter to the shortcode:

[discourse_sso_client login='Login Through the Forum' redirect=https://wordpress.example.com/%D7%90%D7%90%D7%90%D7%90/]

That will create a link like this:

<a href="https://wordpress.example.com/?discourse_sso=1&redirect_to=https://wordpress.example.com/%D7%90%D7%90%D7%90%D7%90">Login Through the Forum</a>

You can also manually create a login link instead of using the shortcode. It needs to have the following query parameters:

?discourse_sso=1&redirect_to=https://example.com/your-wordpress-page

#5

I am aware that I can pass the redirect string into the shortcode, but that is not always practical. For example in my case (which I think is common), the shortcode is embedded in a sidebar shared in all pages of the website. So overriding the redirect means that users will never be redirected to the right page.

I guess i could write my own shortcode for that somehow… anyway, thanks for the answer and please consider this a feature request to support wordpress with unicode urls :slight_smile: