question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local storage is missing an ID Token, Please authenticate

See original GitHub issue

** Which Category is your question related to? ** Authentication

** What AWS Services are you utilizing? ** Cognito

** Provide additional details e.g. code snippets ** I am using Amplify within Angular 6. Before Angular 6, I was using a much older version of Amplify that didn’t support much more than Cognito with Angular 5 and this workflow worked just fine. I keep seeing this error message reported all over the place when I google it, but I can’t seem to find what the proper resolution is.

When I call Auth().signIn(), I get a cognitoUser back and can see all the details when I output the object to the console

Next when I then try passing the user to Auth().userAttributes(), it causes this error.

“Local storage is missing an ID Token, Please authenticate”

What is the actual cause of this, is there extra configuration that has to be done that I’m not aware of? My config is setup as follows:

{
      "Auth": {
        "region": "us-east-1",
        "userPoolId": "us-east-*******",
        "identityPoolId": "us-east-1:***************************",
        "userPoolWebClientId": "*****************************"
      }
    }

Do I need anything additional in either the config or in code to get this back up and running?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:13

github_iconTop GitHub Comments

10reactions
tqhoughtoncommented, Dec 4, 2018

You guys need to use the completeNewPassword method instead of changePassword. This will actually complete the auth challenge presented by the API.

4reactions
alexapamcommented, Oct 10, 2018

I am having the same problem as dguisinger.

After Auth.signIn() returns the User object but tokens are not found in browser’s localStorage. Also like dguisinger, the state of my testuser account is ‘requireNewPassword’ as it is created in the AWS Console for Cognito by admin. This may be a factor. calling Auth.userAttributes will produce same error trace as above.

I am using Ionic 3 & Angular 5.

Can we escalate this problem? Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Local storage is missing an ID Token, Please authenticate ...
I am building an application. In that Sign up, Signin and other operations are working fine. But, when I try to change password...
Read more >
Local storage is missing an ID Token, Please authenticate ...
After so much of struggle, I figured out that I was creating new Cognito user every time using poolData = { UserPoolId: "XXXXXXXXXXXXXXXXX" ......
Read more >
Best practices of storing cognito idToken : r/aws - Reddit
Yes. The tokens remain encrypted in local storage. I did the same thing you did. Started with the hosted UI, then moved to...
Read more >
amazon-cognito-identity-js - npm
The Amazon Cognito Identity SDK for JavaScript allows JavaScript enabled applications to sign-up users, authenticate users, view, delete, ...
Read more >
Amazon Cognito Authentication - Cypress Documentation
Amazon Cognito is an authentication provider apart of Amazon Web Services ... idToken.jwtToken ) window.localStorage.setItem( `${keyPrefixWithUsername}.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found