Take the 2-minute tour ×

After getting the auth Token how to use it to login with google credentials

 AccountManager am=AccountManager.get(this); 
 Account[] accounts= am.getAccountsByType("com.google");
 amf = am.getAuthToken(account,"com.google", true,  
        new AccountManagerCallback<Bundle>() {  
   public void run(AccountManagerFuture<Bundle> arg0) {  

                try {  
                    Bundle result;  
                    Intent i;  
                    String token;  

                    result = arg0.getResult();  
        if (result.containsKey(AccountManager.KEY_INTENT)) {  
                        i = (Intent)result.get(AccountManager.KEY_INTENT);  
                        if (i.toString().contains("GrantCredentialsPermissionActivity")) {  

                        } else {  

                    } else {       
 token = (String)result.get(AccountManager.KEY_AUTHTOKEN);  

I have got the generated API key from google Account,but where to send the authToken and API key so that user can login using his gmail credentials

share|improve this question

1 Answer 1

It's not recommended using Gmail credentials, since Google+ and Gmail is merged, what you actually want, is to be able to login with Google+. This will also make you able to make API calls.

Read more implementing Google+ sign in, in your app here

share|improve this answer
What do you mean by `not recommended'? Why can't a person be free to use or not use google plus along with gmail? –  fremmedehenvendelser Jun 6 at 8:26

Your Answer


