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.

NotAuthorizedException Invalid login token. Couldn't verify signed token

See original GitHub issue

Describe the bug I’m using amplify-authenticator for Vue, and intermittently when I go to my app I will get a not authorized exception. Then I refresh (I don’t login again), and it works.

To Reproduce I’m not sure exactly how to reproduce this. I run into it about 3% of the time.

Expected behavior Authentication should not fail intermittently.

Code Snippet I’m not sure what code would be most relevant, but here is how I’m using the amplify-authenticator component:

                    <amplify-authenticator>
                        <amplify-sign-in
                            slot="sign-in"
                            header-text=""
                            username-alias="email"
                            submit-button-text="LOGIN"
                            hide-sign-up
                        ></amplify-sign-in>

                        <div v-if="signedIn">
                            <Header />
                            <nuxt />
                            <Footer />
                        </div>
                    </amplify-authenticator>

Here is the response I get from the authentication request:

{"__type":"NotAuthorizedException","message":"Invalid login token. Couldn't verify signed token."}

And then when my app tries to make API calls after failing to authenticate:

{"message":"Missing Authentication Token"}

Please let me know if there’s any more information I can provide to help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mitchconquercommented, Feb 28, 2022

Thank you for this @srchulo. Putting your thinking out there helped me solve my issue too. We are using Amplify to power a Chrome extension where the user signs in to the Options page and we pass the session data to the Context via local storage.

We had a similar issue where the token was expired so calls were failing and it was because we were calling Auth.Credentials.set which eventually calls Cognito with the GetIdCommand which failed because the session needed to be refreshed. Calling Auth.currentSession first seems to have cleared up the issue!

0reactions
iartemievcommented, Apr 12, 2021

@srchulo,

We are going to close this issue since we have not heard from you.

Please let us know if you still need support and provide current steps to reproduce if you haven’t already. We can reopen the issue to investigate further.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aws-Amplify NotAuthorizedException: Invalid login token ...
I receive this error "NotAuthorizedException: Invalid login token. Couldn't verify signed token.". How can i resolve it? Auth.
Read more >
AssociateSoftwareToken - Amazon Cognito User Pools
This exception is thrown when the software token time-based one-time password (TOTP) multi-factor authentication (MFA) isn't activated for the user pool. HTTP ...
Read more >
AssumeRoleWithWebIdentity - Amazon Security Token Service
Example providers include the OAuth 2.0 providers Login with Amazon and ... (IDP) that was asked to verify the incoming identity token could...
Read more >
Invalid login token. Incorrect token audience. - Gluu Support
Audience cannot be longer than 255 character" ... occurred (NotAuthorizedException) when calling the GetId operation: Invalid login token.
Read more >
Server-side lambda: providerName doesn't match issuer
The login is from a Cognito User Pool which uses ADFS as a ... I get an error that says "NotAuthorizedException: Invalid login...
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