Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only Id Token is null while signing via Android , IOS is working fine. #147494

Open
thufail14 opened this issue Apr 28, 2024 · 1 comment
Open
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@thufail14
Copy link

Steps to reproduce

  1. Click on the sign in button via an android phone.
  2. Returning only ID token as null.

Expected results

  1. Need to return the ID Token

Actual results

  1. Returning the ID Token as null.

Code sample

Code sample

Future handleSignIn() async {
try {
_googleSignIn.disconnect();

  final GoogleSignInAccount? account = await _googleSignIn.signIn();

  bool isAuthorized = account != null;

  log('onCurrentUserChanged....... $account');

  if (isAuthorized) {
    log('onCurrentUserChanged isAuthorized ${account.id} ${account.email}');

    GoogleSignInAuthentication googleSignInAuthentication =
        await account.authentication;

    // Access token
    String? accessToken = googleSignInAuthentication.accessToken;
    log('Access Token: $accessToken');

    // You can also get the ID token
    String? idToken = googleSignInAuthentication.idToken;
    log('ID Token: $idToken');
  } 
} catch (error) {
  log('handleSignIn Error: $error');
}

}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Apr 29, 2024
@danagbemava-nc
Copy link
Member

Hi @thufail14, can you try #20903 (comment) to see if it works for you? If it does not, can you share how you setup your project for google sign in?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

2 participants