Invalid state in OAuth flow
See original GitHub issueWhen I log in through the hosted UI, I am redirected to my domain with a code. All was working fine with version 1.1.23, when I upgraded to 1.1.25 I got an exception “Invalid state in OAuth flow”
The exception is thrown from
OAuth.prototype._validateState = function (urlParams) {
if (!urlParams) {
return;
}
var savedState = oAuthStorage.getState();
var returnedState = urlParams.state;
if (savedState !== returnedState) {
throw new Error('Invalid state in OAuth flow');
}
};
When I check savedState and returnedState, savedState is null and returnedState is undefined
- Device: MacBook Pro
- OS: 10.13.6
- Browser Chrome
- Version 73
[DEBUG] 36:20.15 AuthClass - getting current authenticted user ConsoleLogger.js:78 [DEBUG] 36:20.77 AuthClass - cannot load federated user from auth storage ConsoleLogger.js:78 [DEBUG] 36:20.78 AuthClass - get current authenticated userpool user ConsoleLogger.js:78 [DEBUG] 36:20.78 AuthClass - Failed to get user from user pool ConsoleLogger.js:88 [DEBUG] 36:20.79 AuthClass - The user is not authenticated by the error
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Invalid state using oauth-client - Laracasts
I started working on a small project using Laravel / Github oAuth-client ... after I authenticate i get this error message : invalid...
Read more >Paw Oauth2 Implicit Grant Flow: Invalid State in authorization ...
I have a web front-end that works great -- I can authenticate via Slack and get a token from my callback method (via...
Read more >Invalid state error after using Oauth with Auth0 React SPA
Hello, I've been trying to implement the Intercom Oauth flow in my app that is powered by Auth0. Unfortunately, after I get redirected...
Read more >Invalid state when logging into connected python web app
I am having trouble setting up Salesforce as an auth provider for my Django application using Django Allauth, getting "No_Oauth_State: State ...
Read more >Invalid State Error - Hosted UI - AWS re:Post
... -with-amazon-cognito-oauth2-implementation/ I have a static we. ... The problem is, when I log in with that account, I get an invalid State...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
II’m also getting this issue with my react application while using amplify. I have version 3.0.23.
EDIT:
I discovered the issue was due to my app client being configured with a client secret, which should not have been for the case of a react web application. I resolved this by creating a new app client and specifically unchecking “generate client secret” option and reconfigured my react app’s Cognito configurations with the new client_id.
Hi,
I am working on a fix for this, thanks for the patience.