Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9106505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:21:19+00:00 2026-06-17T02:21:19+00:00

I have a strange issue. I am using google authentication and this works on

  • 0

I have a strange issue. I am using google authentication and this works on android > 3.x

But I tested on Samsung Handled (android version 2.3.3) and userinfo.email scope didn’t work.

oauth2:https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email

But after some trials, I found how to make it to work. Just needed to swap scopes:

oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile

This worked until I upgraded to android 2.3.5 version. After that, I couldn’t get token with right for grab user email. I tried swap using only email, but nothing worked.

My code:

private static final String SCOPE = "oauth2:https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email";

    am.getAuthToken(account, SCOPE, null, this, new AccountManagerCallback<Bundle>() {
        public void run(AccountManagerFuture<Bundle> future) {
            try {
                Bundle result = future.getResult();                 
                String token = result.getString(AccountManager.KEY_AUTHTOKEN);
                Log.d(TAG, "Google tokenas: " + token);


                authWithToken("google", token); //here I get working token, but this token don't have rights to grab user email
            } catch (OperationCanceledException e) {
                unsuccess();
            } catch (AuthenticatorException e) {
                unsuccess();
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }, new Handler(new Handler.Callback() {

        public boolean handleMessage(Message msg) {
            Log.d(TAG, "on error: " + msg.what);
            return false;
        }

    }));

This method is still working on android 4.0.4 and 4.1.x.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:21:20+00:00Added an answer on June 17, 2026 at 2:21 am

    I found problem. Problem is cached access token. Android don’t check access token validation. If access token is invalid I just clear cache and try authentication again:

            am.invalidateAuthToken("com.google", token);
            auth(lastAccount);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have a strange issue using the ASIHTTPRequest library when I attempt to upload
I have a strange issue with an Asp.NET MVC application. Using Asp.NET MVC 3
I have a strange issue using HttpWebRequest, I'm trying to post a string to
I have a really strange issue when using hibernate to connect to a MySQLDB
We have a strange issue with running an Facebook IFrame application (using MVC 2).
I have a strange issue, I am using IOS6 and I am trying to
This has been a recurring, strange issue for me when accessing URLs using py-appscript,
I have some strange issue using jQuery Validation plugin. Firs of all here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.