Retrieve avatar automatically from Google/Facebook/X

AI-generated summary

The discussion revolves around the feature request to automatically retrieve avatars from social media platforms like Google, Facebook, and Twitter when users sign up via these accounts. peter_imai initiates the topic, noting that despite signing up with Google, they were assigned a default avatar instead of their Google profile picture. codinghorror clarifies that Discourse currently does not support automatic avatar retrieval from these platforms, though they welcome pull requests for such a feature. Greg_Swallow provides technical insight, explaining that if a user authenticates via Facebook, their Facebook ID is stored and their profile picture can be accessed via the Facebook Graph API. TheLoneCuber strongly advocates for this feature, calling it a natural extension of social logins. riking offers implementation tips, such as adding options to the avatar change modal for social account linking. ChrisBeach supports the idea, emphasizing the value of pulling avatars from Twitter, Google, and Facebook.

Definitely a somewhat frivolous question:

I just signed up with my google ID, but was given this geometric pattern as an avatar instead of my normal profile pic associated with my google account. Any reason for this or plan to change this?

Very excited for Discourse!

3 Likes

We don’t have plans to automatically retrieve avatars from Twitter, Facebook, G+ etc at this time.

What we do offer is standard Gravatar (email) avatar support as well as custom local avatars.

ok thanks @codinghorror

However, if someone wants to submit that as a community contributed PR that would be great!

4 Likes

If a discourse user authenticates with Facebook, does their Facebook user ID get saved in the database?

If so, their profile picture can be found at this URL:

http://graph.facebook.com/USERID/picture?type=small

eg - http://graph.facebook.com/zuck/picture?type=small

edit - or actually, to make it square & 50x50
http://graph.facebook.com/zuck/picture?type=square
(You are supposed to be able to add &height=45&width=45 but it seems that the smallest it will resize to is 48 pixels)

More info here - https://developers.facebook.com/docs/graph-api/reference/v2.0/user/picture

2 Likes

Come on someone [with the skills to do it]… PR Social Avatars please. I’m surprised they’re not a part of Discourse: the friction-free social logins seem such a contradiction given that users then have to manually upload a profile picture, even though they have one set for the social login they’ve just used. It’s such a confusing prospect for Joe and Jane Public who are not forum frequenters.

3 Likes

Tips for the implementers:

  1. Add more options to the avatar changing modal dialog (titled “Change your avatar”)
  2. Pull the ‘Associated accounts’ records (example is on the admin user page, these should be visible to the user somewhere)
3 Likes

+1 for automatically pulling avatars from Facebook / Google / Twitter.

1 Like