# Import GitHub image as profile image when authenticating with GitHub

**URL:** https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132
**Category:** Feature
**Created:** [August 24, 2016, 5:45am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132 "2016-08-24T05:45:44Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ossia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ossia/32/215651_2.png) [@ossia](https://meta.discourse.org/u/ossia)
#### Post date: [August 24, 2016, 5:45am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/1 "2016-08-24T05:45:44Z")

</div>

User story: As a new user, when I authenticate with GitHub, my profile image should automatically become whatever my GitHub profile image is.

According to @codinghorror this is not currently on the roadmap. I am not 100% sure whether this should be a plugin or an option in available in Discourse. It sounds like a plugin would be the faster route, unless this is a feature that other admins would benefit from.

[previous discussion on this topic](https://meta.discourse.org/t/git-hub-profile-image-not-importing/46117)

CC @michaelhenderson

---

<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: [August 24, 2016, 6:12am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/2 "2016-08-24T06:12:34Z")

</div>

This can be in core if someone wants to add it, but the default should not be to override avatars, just populate if blank.

Site setting if anyone wants override behavior.

---

<div class="post-metadata">

### Author: ![divyanshumehta](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@divyanshumehta](https://meta.discourse.org/u/divyanshumehta)
#### Post date: [February 5, 2017, 4:18am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/3 "2017-02-05T04:18:29Z")

</div>

Well yes. Even I think it is an desirable feature. Yesterday I signed in with Github and my profile picture didn’t get updated with my profile picture on Github.  
The meta pages also lack this, I think it would be a good feature to see implemented.

---

<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: [February 6, 2017, 2:27pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/4 "2017-02-06T14:27:39Z")

</div>

There is a #pr-welcome tag on this, so … a pull request from the community is welcome.

---

<div class="post-metadata">

### Author: ![OrthoDex](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orthodex/32/69146_2.png) [@OrthoDex](https://meta.discourse.org/u/OrthoDex)
#### Post date: [March 13, 2017, 1:45pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/5 "2017-03-13T13:45:09Z")

</div>

Hello!  
It’s my first time contributing to Discourse. I’ve setup my dev environment and a test account.  
Do you mind if I give this a shot? 😄

---

<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: [March 13, 2017, 1:48pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/6 "2017-03-13T13:48:19Z")

</div>

Sure, go for it! 🙂 ❤

---

<div class="post-metadata">

### Author: ![OrthoDex](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orthodex/32/69146_2.png) [@OrthoDex](https://meta.discourse.org/u/OrthoDex)
#### Post date: [March 21, 2017, 6:52pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/7 "2017-03-21T18:52:12Z")

</div>

Hello @sam

I am using `#retrieve_avatar` similar to the one used in facebook\_authenticator.rb. However, I am getting a bug where the user params aren’t being put inside a :user\_fields key when being processed by `UserController#create`, causing `params.permit(:user_fields)` to fail.

I don’t think my changes to the github\_authenticator have caused this. 😕

While debugging the issue, I also noticed that #strip is called on params[:email], which is an array causing the failure. This error fails silently and doesn’t show up in the logs.

Is it just me experiencing the issue?

---

<div class="post-metadata">

### Author: ![bekicot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekicot/32/116294_2.png) [@bekicot](https://meta.discourse.org/u/bekicot)
#### Post date: [March 29, 2017, 10:08pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/8 "2017-03-29T22:08:39Z")

</div>

Are you still working on this issue?  
If not, I can continue to help to resolve this issue. 😉

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [August 23, 2017, 7:52am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/9 "2017-08-23T07:52:31Z")

</div>

Implemented per

[https://github.com/discourse/discourse/pull/5073](https://github.com/discourse/discourse/pull/5073)

Cheers!

---

<div class="post-metadata">

### Author: ![ossia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ossia/32/215651_2.png) [@ossia](https://meta.discourse.org/u/ossia)
#### Post date: [August 23, 2017, 2:25pm UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/10 "2017-08-23T14:25:14Z")

</div>

Awesome! This will save people a lot of time! Thanks!

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [September 3, 2017, 9:51am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/11 "2017-09-03T09:51:34Z")

</div>

A post was split to a new topic: [Import profile picture for GitHub OAuth](https://meta.discourse.org/t/import-profile-picture-for-github-oauth/69279)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 24, 2017, 12:34am UTC](https://meta.discourse.org/t/import-github-image-as-profile-image-when-authenticating-with-github/49132/12 "2017-08-24T00:34:49Z")

</div>


