# Oauth2 json avatar path not working

**URL:** https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349
**Category:** Bug
**Created:** [February 5, 2019, 12:08am UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349 "2019-02-05T00:08:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kueda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kueda/32/130762_2.png) [@kueda](https://meta.discourse.org/u/kueda)
#### Post date: [February 5, 2019, 12:08am UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349/1 "2019-02-05T00:08:26Z")

</div>

I’m trying to get the oauth2 basic plugin working on a trial version of hosted Discourse. Everything seems to work, except for the `oauth2 json avatar path`, so I suspect I’m just doing something wrong. The response to the user JSON request looks something like this:

```plaintext
{
  "email": "an.email.address@gmail.com",
  "id": 123,
  "login": "anemailaddress",
  "name": "An Email Address",
  "medium_user_icon_url": "https://static.inaturalist.org/attachments/users/icons/61724/medium.jpg?1475527316",
  "original_user_icon_url": "https://static.inaturalist.org/attachments/users/icons/61724/original.jpg?1475527316",
  "user_icon_url": "https://static.inaturalist.org/attachments/users/icons/61724/thumb.jpg?1475527316"
}

```

I’ve set the `oauth2 json avatar path` to `original_user_icon_url` (I’ve tried `medium_user_icon_url`, too), but every time I create a new account via OAuth, the user’s avatar image is just the default colored circle with the first letter of their name. Username, name, and email import just fine. This feels buggy, but am I just missing a configuration here?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 5, 2019, 11:23am UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349/2 "2019-02-05T11:23:33Z")

</div>

Any ideas here @david ?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [February 5, 2019, 2:54pm UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349/4 "2019-02-05T14:54:29Z")

</div>

Hi @kueda, I think I see the issue here. We didn’t fetch the avatar on the initial login - it only happened on subsequent logins. This should fix the problem:

[https://github.com/discourse/discourse-oauth2-basic/commit/090f63c4290672a4e399f7c68b84a4f896ca6d36](https://github.com/discourse/discourse-oauth2-basic/commit/090f63c4290672a4e399f7c68b84a4f896ca6d36)

~~Please update to the latest version of the plugin and see if that helps.~~

~~I see you’re on one of our trials. I’ll let you know once we’ve updated your site.~~

All up-to-date - let us know how you get on @kueda 🙂

---

<div class="post-metadata">

### Author: ![kueda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kueda/32/130762_2.png) [@kueda](https://meta.discourse.org/u/kueda)
#### Post date: [February 5, 2019, 6:26pm UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349/5 "2019-02-05T18:26:07Z")

</div>

Awesome, working now. Thanks for the quick turnaround!

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [February 6, 2019, 6:00pm UTC](https://meta.discourse.org/t/oauth2-json-avatar-path-not-working/108349/6 "2019-02-06T18:00:00Z")

</div>

This topic was automatically closed after 23 hours. New replies are no longer allowed.
