# GitHub login with multiple email addresses

**URL:** https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366
**Category:** Support
**Created:** [December 16, 2016, 6:57pm UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366 "2016-12-16T18:57:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### Post date: [December 16, 2016, 6:57pm UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/1 "2016-12-16T18:57:10Z")

</div>

When a user selects ‘GitHub’ as the auth provider for logging in, and they have multiple email addresses in their GitHub profile, are all of those addresses provided to Discourse (or only the primary address)? If all the addresses are provided, does Discourse then search for an account matching any one of them?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 16, 2016, 8:50pm UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/2 "2016-12-16T20:50:50Z")

</div>

I’m pretty sure that it uses only the one listed as ‘public email’.

---

<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: [December 20, 2016, 1:36am UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/3 "2016-12-20T01:36:39Z")

</div>

> [@kpfleming](#):
>
> does Discourse then search for an account matching any one of them?

Yes that is how it works, we even respect email whitelists and blacklists

[https://github.com/discourse/discourse/commit/2ae7c47a3ccd0412db3eddb7f99d3a2e9e0e119e](https://github.com/discourse/discourse/commit/2ae7c47a3ccd0412db3eddb7f99d3a2e9e0e119e)

---

<div class="post-metadata">

### Author: ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### Post date: [January 3, 2017, 2:25pm UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/4 "2017-01-03T14:25:56Z")

</div>

OK, so here’s my situation: I have a blacklist with one domain on it, but we also have a custom authenticator plugin which is allowed to authenticate users with addresses in that domain. What I want to avoid is a user creating an account using an address from the special domain (using our custom authenticator to do so), but then later using GitHub login with that email address as one of their addresses. I haven’t read the code in the link above, but I believe that our desired behavior should work, as GitHubAuthenticator should reject the login if _any_ address provided by [github.com](http://github.com) is in a blacklist domain.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 16, 2019, 1:50am UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/5 "2019-04-16T01:50:44Z")

</div>



---

<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: [April 16, 2019, 4:39am UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/6 "2019-04-16T04:39:01Z")

</div>

Hi Kevin, did you ever work this out?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 13, 2022, 10:12am UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/7 "2022-07-13T10:12:41Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 13, 2022, 10:16am UTC](https://meta.discourse.org/t/github-login-with-multiple-email-addresses/54366/8 "2022-07-13T10:16:23Z")

</div>


