need help to extract id_token
kiran321 opened this issue · comments
void webLogin() async {
try {
var response = await auth.webAuth.authorize({
'audience': 'https://${auth.auth.client.domain}/userinfo',
'scope': 'openid email offline_access',
});
print(response);
DateTime now = DateTime.now();
showInfo('Web Login hi', '''
\ntoken_type: ${response['token_type']}
\nexpires_in: ${DateTime.fromMillisecondsSinceEpoch(response['expires_in'] + now.millisecondsSinceEpoch)}
\nrefreshToken: ${response['refresh_token']}
\naccess_token: ${response['access_token']}
\nid_token:${response['id_token']}
''');
webLogged = true;
currentWebAuth = Map.from(response);
This is from devdennysegura/flutter-auth0 (Pkce.dart)
This line: \nid_token:${response['id_token']}
is giving the jwt token, Want to save this id_token in sharedpreference , How to achieve it?
In lib/models/appstate.dart, you have the logIn() method. As you can see, it is already stored in sharedpreferences as idToken.