furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
187 stars 114 forks source link

what fields of CognitoUserSession need saving for the session to persist? #172

Closed nyck33 closed 3 years ago

nyck33 commented 3 years ago

I just learned about flutter_secure_storage here: https://pub.dev/packages/flutter_secure_storage/install and was wondering why SharedPreferences was chosen over it in the example.

nyck33 commented 3 years ago

Are these enough or do I also need to save payload from JwtToken?

print(
        '\n\nuser_service getCredentials _session:\n id_token: ${_session?.getIdToken().getJwtToken()}\nrefreshToken: ${_session?.getRefreshToken()?.getToken()}\n access token: ${_session?.getAccessToken().getJwtToken()}\n clockdrift: ${_session?.getClockDrift()}\n\n');
nyck33 commented 3 years ago

This is probably it: https://github.com/furaiev/amazon-cognito-identity-dart-2/issues/82#issuecomment-669139576 I'll try in the morning.