SSO Avatars not showing for users that existed before we started using SSO


#1

Good day,

We are successfully using Discourse with SSO from our main site. We have the sso_overrides_avatar setting set to true, and are passing the avatar url in the payload. This is working for standard accounts, but for the Admins the avatar is not shown.

If I look at the admin view of the user’s profile, I can see the Profile Picture URL populated with an external url. If I paste this url in a new browser window I see the correct avatar. The Profile Picture, however, (on this page and everywhere else) shows the standard shadow icon.

image

It is possible that these accounts were created before I enabled SSO, could that cause the problem?

Any suggestions how to start troubleshooting this?

Thanks!


#2

Further information – I created a new administrator account on our website and signed into our forum via SSO – the avatar showed up correctly. So it’s not related to the fact that the account is an Admin, the problem is due to the account existing before SSO was turned on. Any suggestions for workarounds?


#3

For future information in case anyone else has this problem. I ended up logging into the database and running these commands:

select * from user_avatars where user_id = {userid}

I grabbed the custom_upload_id value from that row and then ran this:

delete from uploads where id = {uploadid};

followed by:

delete from user_avatars where user_id = {userid}

Then I logged back in via SSO and the correct avatar began showing.