Error updating site info using SSO after update


(Steven Greco) #1

Updated Discourse to v1.3.0.beta6 +20 and SSO stopped working showing this error:

Error updating information, contact site admin

I am running SSO with Wordpress using the “Official” Discourse wordpress plugin.

Looking at the logs i am getting a job exception error for the avatar URL. Not sure why its replacing my URL with “valid-host/avatar/…”:

Job exception: bad URI(is not URI?): http://valid-host/avatar/8873fecd2e0ccc4af0c54c8bdb1aab99?s=96&d=http%3A%2F%2Fgrimreapergamers.com%2Fwp-content%2Fthemes%2Fgameaddict-child%2Fimages%2Fgrg-default-avatar.png&r=x

I have posted the full log (backtrace, env) info to pastebin here: http://pastebin.com/nfgvQn3z

Thanks


(Steven Greco) #2

so digging into this a bit more it seems to only come up for users using gravatar. The $params array is pulling the right URL but for gravatar links it throws the bad uri error.

Here is what the url looks like in my array.

[avatar_url] => http://2.gravatar.com/avatar/8873fecd2e0ccc4af0c54c8bdb1aab99?s=96&d=mm&r=x

Entering this url into my browser returns the correct avatar image.

Edit: It seems Discourse does not like the parameters that are at the end of the Gravatar URL if i strip off everything after the hash for the gravatar is goes through fine.


(Steven Greco) #3

Wondering if anyone else has this issue where Discourse does not like the parameters at the end of the URL. I think i can doctor the plugin to strip off the parameters for the url. But curious as to why it no longer accepts them.


(Steven Greco) #4

I started to dig into this more as i was having issues with the avatar update from wordpress.

I found out that since wordpress version 4.2 it now includes its own get_avatar_url function. Not sure how this reacts with the function of the same name in the wp-discourse plugin. Removing this function and rewriting to use the wordpress function has removed my issues. It also provides a bit cleaner url for the avatar.

I created a pull request with this fix for the wp-discourse plugin.