Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update token #67

Open
nicolas-idata opened this issue Nov 25, 2019 · 4 comments
Open

Update token #67

nicolas-idata opened this issue Nov 25, 2019 · 4 comments

Comments

@nicolas-idata
Copy link

I hope you can help me.

When i generate a token using getIdToken().getJwtToken() it works great, the problem is that i dont know how to deal with refresh. So, eventually the token expires and i get a 401 error.

Can anyone please tell me how can i get a new token ? thanks!

Nick

@karan-appgambit
Copy link

Same issue

1 similar comment
@drakebw
Copy link

drakebw commented Jan 16, 2020

Same issue

@ni3galave
Copy link

Any support refresh token ?

@Karanchamp
Copy link

I found temporary solution
I write one function in UserService class

Future<String> getIdToken() async {
    if (_session == null || _session.idToken == null) {
      return null;
    }
    if (!_session.isValid()) {
      print("Refreshing Token...");
      _session = await _cognitoUser.getSession();
    }
    return _session.idToken?.getJwtToken();
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants