Sign in with your Gmail credentials

Can I use Google credentials to get basic user information like

Email, Name, Gender

and use them in my application? This allows the user to log into my application using Gmail.

I asked the same thing here .

But the answer says:

You must not use Gmail to authenticate users with Google Accounts. Instead, you can use Google + to sign in to Android. This will allow you to access user profile information after obtaining the required permissions using OAuth. Check out the manual here:

which I followed, and everything worked fine.

But if the Gmail account does not have a GooglePlus profile, My application asks to create a GooglePlus account. This makes me think that I implemented Login GooglePlus instead of logging into Gmail.

Is the answer to my question correct? Meaning without a GooglePlus profile you cannot log in to Gmail on Android?

If not, how can I use Google Login in my application?

A similar question is here , with no answers.

Please, help. Thank you.

+2
source share
3 answers

Try the article at this address: http://nilvec.com/implementing-smtp-or-imap-xoauth-authentication-in-java.html .

I think this will help you.

+3
source

Documentation on using Google OAuth2 for user authentication is available at https://developers.google.com/accounts/docs/OAuth2Login . However, as the page notes, you and your users get additional features if they use a Google+ and Google+ account, but this is not necessary.

Necessary areas:

  • https://www.googleapis.com/auth/userinfo.profile for name and gender
  • https://www.googleapis.com/auth/userinfo.email for user email address

Refresh . I have to change that these areas are now outdated and planned for removal. See the URL above for more details.

+1
source

I would not confuse the gmail and Google+ accounts as different things. In fact, you want the user to authenticate with their Google account, which covers many services.

On Android, the easiest way to create authentication with Google accounts is to use the Google Play Services SDK , which includes services such as Google ..

Google+ documents a cross-cutting approach to using the Google Play Services SDK that covers the issues you requested using PlusClient :

+1
source

Source: https://habr.com/ru/post/1493362/


All Articles