Let’s say I have two OAuth providers, Google and GitHub with which user can create an account in my Django application. I wrote a custom user model and a custom model for storing OAuth details (provider and user ID from provider etc.).
Let’s say the user logs-in with GitHub first and creates an account. He logs out, signs-up again, but this time with Google.
Now what happens? How can I know that the user already has an account linked with GitHub? I cannot check the email because their email can be different for different platforms. I cannot use the ID of the user from OAuth provider too.
Please do not ask me to use libraries, I’m willing to learn how to implement it on my own.
Sakthi Santhosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.