问题
I am trying to connect my users with my back end server , i used the example from the official google sign in plugin for flutter : https://pub.dartlang.org/packages/google_sign_in
the sign process goes fine and i get the username and email ect.. but i need the id Token to authenticate the user with my server.
Ps: Not using firebase , only google sign in.
Can anyone guide me how to get the id Token ?
回答1:
You can try using this
_googleSignIn.signIn().then((result){
result.authentication.then((googleKey){
print(googleKey.accessToken);
print(googleKey.idToken);
print(_googleSignIn.currentUser.displayName);
}).catchError((err){
print('inner error');
});
}).catchError((err){
print('error occured');
});
来源:https://stackoverflow.com/questions/52458968/did-anyone-manage-to-get-the-id-token-from-google-sign-in-flutter