gregertw / actingweb_firstapp

Starter app for Flutter that includes many different production app features; some not typically included in demo apps.

Home Page:https://medium.com/flutter-community/why-and-how-you-should-use-a-flutter-starter-app-even-if-you-are-not-a-beginner-78bd901dea5a

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.