Флаттер гугл авторизация тип ответа OAuth 2 - PullRequest
0 голосов
/ 14 апреля 2020

В настоящее время я использую пакет входа в систему Google вместе с авторизацией firebase для авторизации. У меня есть серверная часть, к которой мне нужно авторизоваться, когда я пытаюсь проверить токен идентификатора, который я получаю от входа в Google по https://www.googleapis.com/oauth2/v1/tokeninfo?id_token= Я получаю следующий ответ:

I/flutter (13234): IS OAUTH ID TOKEN VALID?: {
I/flutter (13234):   "iss": "https://accounts.google.com",
I/flutter (13234):   "azp": "88741vq268aj3t4p68l.apps.googleusercontent.com",
I/flutter (13234):   "aud": "88741690snaqa206bnut93.apps.googleusercontent.com",
I/flutter (13234):   "sub": "117293359314859019528",
I/flutter (13234):   "email": "",
I/flutter (13234):   "email_verified": "true",
I/flutter (13234):   "name": "",
I/flutter (13234):   "picture": "https://lh3.googleusercontent.com/a-/",
I/flutter (13234):   "given_name": "",
I/flutter (13234):   "family_name": "",
I/flutter (13234):   "locale": "en",
I/flutter (13234):   "iat": "15826",
I/flutter (13234):   "exp": "15869426",
I/flutter (13234):   "alg": "R56",
I/flutter (13234):   "kid": "6fcf4a30ff5a",
I/flutter (13234):   "typ": "JWT"
I/flutter (13234): }

проблема в том, что у него нет значений at_ha sh и jti, поэтому проверка не проходит.

Вот как я получаю токен,

googleSignInAccount = await googleSignIn.signIn();
    final GoogleSignInAuthentication googleSignInAuthentication =
        await googleSignInAccount.authentication;

String idToken = googleSignInAuthentication.idToken;

 var response = await client.get(
      'https://oauth2.googleapis.com/tokeninfo?id_token=${googleSignInAuthentication.idToken}'
    );

    print('${responseee.body}');

Я знаю, что должен передать тип ответа 'code' при входе, но я не могу передать его где-нибудь ..

Помощь будет принята с благодарностью!

...