• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Login in using Facebook and Google

Redan

Lurker
Hi ,
I am quite new in using OAuth and third-party authentication.
I am building an Android application and i want to integrate "Login using Google" and "Login using Facebook" buttons.
I've already succeeded to retrieve user information (username,email,... ) from both Facebook and Google.
But i have two questions :
1. If a user has signed in using Google with the mail ABC@gmail.com - this mail then is added to the application database , then the same user tried to register with the same mail, and give it a password, what should the application do in this case ? ( Should i bring a "Email already exist" message ?, or just update that user in the application database to have the new entered password ? )

2. If a user has signed in using Google with the email address ABC@gmail.com - this mail is stored in the application database, then the same user tried to sign in using Facebook with the same email address , do i make a new record in the application database indicating the mail : ABC@gmail.com but this time with Facebook. Or i update the same user record ?
which method is proffered ?
 
Well personally, for #1 I would pop up a dialog and ask the user if they wish to replace the existing password.

For #2, it depends on the structure of your database records. I suspect that you would have two records, for Gmail login, and Facebook login. Effectively they are different login credentials.
Although if you only have one record for any Google sign-in, then you would have to ask the user what to do, similar to above - update, or retain existing login credentials.
 
Back
Top Bottom