Login Using Gmail Credentials
Solution 1:
Try article on this Url : http://nilvec.com/implementing-smtp-or-imap-xoauth-authentication-in-java.html.
I think this will help you
Solution 2:
I wouldn't confuse a "gmail" account and a "Google+" account as being different things. Really what you want is for a user to authenticate with their "Google account", which spans many services.
On Android, the easiest way to build authentication with Google accounts is to use the Google Play Services SDK, which includes services like Google sign in.
Google+ documents an end-to-end approach to using Google Play Services SDKs that cover the issues that you asked about by using the PlusClient
:
- Setting up the client
- Getting the user's email address using either
PlusClient.getAccountName()
or the REST methods. - Getting the user's profile info using the
PlusClient.loadPerson()
Solution 3:
Documentation for using Google's OAuth2 to authenticate a user are provided at https://developers.google.com/accounts/docs/OAuth2Login. As the page notes, however, you and your users get additional features if they use a Google+ account and the Google+ Sign-in, but this is not necessary.
The scopes required are
https://www.googleapis.com/auth/userinfo.profile
for name and genderhttps://www.googleapis.com/auth/userinfo.email
for the user's email address
Update: I should amend that these scopes are now deprecated, and scheduled for removal. See the URL above for details.
Post a Comment for "Login Using Gmail Credentials"