# Error updating site info using SSO after update

**URL:** https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881
**Category:** WordPress
**Created:** [2015年四月23日 21:22 UTC](https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881 "2015-04-23T21:22:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [2015年四月23日 21:22 UTC](https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881/1 "2015-04-23T21:22:10Z")

</div>

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&#038;d=http%3A%2F%2Fgrimreapergamers.com%2Fwp-content%2Fthemes%2Fgameaddict-child%2Fimages%2Fgrg-default-avatar.png&#038;r=x

```

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

Thanks

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [2015年四月24日 15:58 UTC](https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881/2 "2015-04-24T15:58:02Z")

</div>

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&#038;d=mm&#038;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.

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [2015年四月27日 12:53 UTC](https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881/3 "2015-04-27T12:53:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [2015年十一月16日 18:18 UTC](https://meta.discourse.org/t/error-updating-site-info-using-sso-after-update/27881/4 "2015-11-16T18:18:01Z")

</div>

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.

[https://github.com/discourse/wp-discourse/pull/171](https://github.com/discourse/wp-discourse/pull/171)
