Auth0 Home Blog Docs

Logging in with Google and then with username and password credentials

social-connections
username-password-co

#1

We have users who have logged in with Google (or another) and later return and try to log in with the same username and password combination that they use to login to Google (or another) service but they are told the user doesn’t exist.

The solution is to tell them to use the SIGN UP process but this seems very unintuitive to us and them and causes problems with our users. They believe they have already kind of signed up already when they logged in with Google originally so having to sign up with the same username doesn’t make sense.

Am I missing something? Is there a better solution to this problem?


#2

Authentication with Google and authentication with custom username/password credentials specific to your application are two independent ways of user authentication. By default, the authentication methods/connections you enable for your client application will work independently of one another.

In summary, a user can authenticate with method/connection A or method/connection B. This will also most likely result in your application treating the authenticated users as two different users even if it’s the same real-person behind both logins.

If a single person wants to authenticate with an already existing account it will have to use the same exact method of authentication.

Having said that, you can extend the default behavior by making use of account linking functionality which would allow a single person to authenticate with different methods and still be seen as the same user in respects to the client application. Account linking assumes that the user authenticated/signed up with both methods before the accounts can be linked, however, you could automate that process by automatically creating a username/password account for every user that authenticates with Google; this way they would not have to manually sign up and could have the both methods of authentication.


#3