# Switching from GitHub auth to OAuth2

**URL:** <https://meta.discourse.org/t/switching-from-github-auth-to-oauth2/111218>\
**Category:** SSO\
**Tags:** oauth2\
**Created:** [March 10, 2019, 6:05pm UTC](https://meta.discourse.org/t/switching-from-github-auth-to-oauth2/111218 "2019-03-10T18:05:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cori](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cori/32/124112_2.png) [@cori](https://meta.discourse.org/u/cori)\
**Post date:** [March 10, 2019, 9:45pm UTC](https://meta.discourse.org/t/switching-from-github-auth-to-oauth2/111218/5 "2019-03-10T21:45:41Z")

</div>

Thanks for the reply!

Sorry, I think that email address error must have been an error from a previous iteration of testing. After a hard refresh and another attempt, this is what I see (and have seen in other cases):

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

Note that the username is automagically-appended with a number to make it into an available one.

Here’s what I see when I query the database using the email address from the OAuth payload from the logs pane:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/7/f788df7e2c0576b302577ba7f182872845c8bfc0.png)

So I feel fairly confident that the email address is correct and matches in the important particulars. That’s the correct username for the account I expect to log in as, for instance, and the user\_id also matches.

Interestingly, here’s what I see when I grab the OAuth payload email for an account that _works_ as expected:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/7/d77ac6b73794b33a9e566a56f43b1ec9efd18ea9.png)

So the token in the OAuth payload from that account made it into the database just fine at some point, but the token returned for the failing user ins’t making it into the database.

Thanks also for the offer for help on our hosted instance. However, before we turn this on in that instance I want to make sure I understand what to expect and whether the solution we’re hoping to leverage is actually going to solve the problem we want to solve. I’d like to give our community members some forewarning and if achieving our goals of having everyone authenticate on our platform means that we have to merge ~1000+ accounts that’s probably not going to work (especially since we don’t have access to the command-line-only merge tool).

Anything else I can look at? If it would be easier to puzzle out I can set up a hosted trial and configure it there - I’m using self-hosted to avoid having a trial expire (and because I hope to do some work on the Slack plugin, for which a stand-alone instance seems required).

---

_[View the full topic](https://meta.discourse.org/t/switching-from-github-auth-to-oauth2/111218)._
