# Avatars not pulling from SSO

**URL:** https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878
**Category:** SSO
**Created:** [7 januari 2019 om 05:59 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878 "2019-01-07T05:59:00Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [7 januari 2019 om 05:59 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/1 "2019-01-07T05:59:00Z")

</div>

I’m using Moodle as an SSO identity provider on 2.2.0beta7, and it all seems to be working fine except user avatars aren’t updating.

I’ve got `sso overrides avatar` set to true, and I’ve got `avatar_force_update` returning true from the payload. The verbose debugging log gives the following output:

```
Verbose SSO log: User was logged on peter

add_groups: 
admin: 
moderator: 
avatar_force_update: true
avatar_url: https://moodle. ***.*** /pluginfile.php/42/user/icon/fordson/f1?rev=490
bio: 
card_background_url: 
email: peter@ ***.***
external_id: 4
groups: 
locale: 
locale_force_update: 
name: Peter *****
nonce: 66905e176b65dfde1eacc9edd5ada50f
profile_background_url: 
remove_groups: 
require_activation: 
return_sso_url: 
suppress_welcome_message: 
title: 
username: peter@ ***.***
website: 

```

I’ve gone through all the other threads on here, but none of the suggestions seem to work. Enqueuing the `download_avatar_from_url` function from the rails console seems to give no error, and there’s absolutely nothing showing up in my logs aside from the verbose sso output. New users show up with the default capital letter avatar, and returning users just keep whatever they had before.

Any tips on how I might further debug would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [10 januari 2019 om 10:13 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/2 "2019-01-10T10:13:21Z")

</div>

The obvious answer is that this is a problem on the SSO provider side, but at least as far as I understand from the verbose SSO log, the proper information is coming back. Any other tips on how I might troubleshoot this?

---

<div class="post-metadata">

### Author: ![consideRatio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/consideratio/32/126623_2.png) [@consideRatio](https://meta.discourse.org/u/consideRatio)
#### Post date: [1 april 2019 om 13:47 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/3 "2019-04-01T13:47:48Z")

</div>

If you go to settings, search for `sso`, there is this setting. Have you enabled it?

![image](https://global.discourse-cdn.com/meta/original/3X/2/b/2b547c2647e34d47047e7ad43d02bcbb18c7b8a5.png)

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [1 april 2019 om 14:08 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/4 "2019-04-01T14:08:54Z")

</div>

It’s enabled, unfortunately. I’ve played with just about every combination I can think of on those settings, but no joy.

---

<div class="post-metadata">

### Author: ![consideRatio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/consideratio/32/126623_2.png) [@consideRatio](https://meta.discourse.org/u/consideRatio)
#### Post date: [1 april 2019 om 15:41 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/5 "2019-04-01T15:41:33Z")

</div>

Ah… Then I bet we struggle with the same issue, i dont use the avatar thing, but I struggle with getting the admin / moderator / groups info accounted for instead.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2 april 2019 om 00:42 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/6 "2019-04-02T00:42:05Z")

</div>

Are you 100% certain that the avatar url you provided is something the Discourse container can talk to?

We have tests for this function: [discourse/spec/models/discourse\_single\_sign\_on\_spec.rb at 76669bb5a6dfa8c3425c1988ae7f240f23fd28cf · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/76669bb5a6dfa8c3425c1988ae7f240f23fd28cf/spec/models/discourse_single_sign_on_spec.rb#L523-L550)

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [9 april 2019 om 03:44 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/7 "2019-04-09T03:44:36Z")

</div>

That’s definitely a possibility, and one I’m trying to investigate. I’m wondering if it could be that my cms is serving different things to different clients based on…something. I’m not especially familiar with the moodle backend, but if it’s something to do with that I’ll post a solution here when I find it.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [9 april 2019 om 04:03 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/8 "2019-04-09T04:03:41Z")

</div>

If you throw the avatar url at cURL or wget can you download the asset?

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [9 april 2019 om 04:15 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/9 "2019-04-09T04:15:58Z")

</div>

Yes, without problem. That’s what’s so strange.

---

<div class="post-metadata">

### Author: ![jazinheira](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jazinheira](https://meta.discourse.org/u/jazinheira)
#### Post date: [12 april 2019 om 14:54 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/10 "2019-04-12T14:54:00Z")

</div>

Have you checked to make sure that sidekiq is running properly? I just found out there were some jobs holding things up in the queue and our images are back to normal after fixing that.

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [29 april 2019 om 15:47 UTC](https://meta.discourse.org/t/avatars-not-pulling-from-sso/105878/11 "2019-04-29T15:47:19Z")

</div>

Just to update: no surprise, it looks like the issue is on the moodle end, related to an authentication edge case in the filesystem API. I don’t completely understand it yet, but by changing some settings related to Moodle’s authentication process I am now able to load avatar images appropriately.

I’m not sure why pulling the image via curl worked consistently before, but when I checked again after letting it sit for a few weeks I stopped getting anything. My only guess is that maybe someone upstream from me has some bad caching configured.

Anyway, a sincere thanks to everyone for the help. Things are working great now, and my users are absolutely loving discourse. If I figure out anything more specific, I’ll post it here.
