# Avatar do SSO não está atualizando ao usar URLs do meu site

**URL:** <https://meta.discourse.org/t/sso-avatar-not-updating-when-using-urls-from-my-site/99603>\
**Category:** SSO\
**Created:** [Outubro 16, 2018, 4:15am UTC](https://meta.discourse.org/t/sso-avatar-not-updating-when-using-urls-from-my-site/99603 "2018-10-16T04:15:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![twm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twm/32/141663_2.png) [@twm](https://meta.discourse.org/u/twm)\
**Post date:** [Outubro 16, 2018, 4:15am UTC](https://meta.discourse.org/t/sso-avatar-not-updating-when-using-urls-from-my-site/99603/1 "2018-10-16T04:15:34Z")

</div>

Hello, I hope someone can help me with this.

I’m using the WordPress discourse plugin with WordPress as my SSO provider. I’m trying to set the `avatar_ur`l from a custom user meta field populated with a gravity form.

When I view the logs I can see that the correct `avatar_url` is coming in with the payload.

 ![864da9758d](https://global.discourse-cdn.com/meta/original/3X/7/1/7137decc6e0c2f54280c61a9e2045abad83cae76.png)

Here is the function I’m using to insert the `avatar_url` into the SSO payload. I’ve also tried using the wpdc\_sso\_params filter with the same results.

```
add_filter( 'wpdc_sso_avatar_url', 'gn_use_custom_avatar', 10, 2 );
function gn_use_custom_avatar( $avatar_url, $user_id ) {
    if ( get_user_meta( $user_id, 'user_avatar', true ) ) {
        $avatar_url = get_user_meta( $user_id, 'user_avatar', true );
    }
    return $avatar_url;
}

```

Stranger still, if I set the `$avatar_ur`l to a random image hosted on another site I will see the avatar image update.

I’ve tried using the curl command from my discourse’s docker instance on the avatar URL in the user’s meta and I’m not getting any errors. So, I’m at a loss at how to proceed.

Any idea?

---

_[View the full topic](https://meta.discourse.org/t/sso-avatar-not-updating-when-using-urls-from-my-site/99603)._
