-
Notifications
You must be signed in to change notification settings - Fork 844
Error: No state in response #780
Comments
Also getting "No state in response" error. This is probably related to the I'm using react router, which modifies the URL instead of requesting another page to be loaded. This code: const mgr = new UserManager({
response_mode: 'query',
});
mgr.signinRedirectCallback()
.then(user => {
console.log(user);
})
.catch(error => {
console.error(error);
}); triggers the error after the user object is logged to the console, which suggests that the promise is resolved before all work is finished. This, however, doesn't trigger an error (which is similar to the quickstarts code): const mgr = new UserManager({
response_mode: 'query',
});
mgr.signinRedirectCallback()
.then(user => {
console.log(user);
window.location.href = 'http://localhost:3000';
})
.catch(error => {
console.error(error);
}); |
Hi, also getting this error only if I will use {response_mode:"query"}.
|
If you're using code flow and the call back is on a different page than your normal UserManage config, then you need to explicitly add {response_mode:"query"} on the options on the callback page. If the UserManager on the calmlback page has the response_mode set then it will know the right place to look for the response params. |
No I am using Implicit Flow but with a specific callback page (different than the originator). |
@brockallen note that in both my snippets I'm using the same configuration on the same page, the first throws the The second snippet doesn't throw an error for some reason? Is the state variable not being checked at all before the redirect which eats up the error? |
If the config is the same on the 2 pages, then there's an issue in your hosting perhaps? A common issue is that you're mixing http and https. If it's not that, then you will have to debug into it more. |
Closing. If you still have issues, feel free to reopen. |
not works for me( |
@Manimall In my case removing |
@EricHerlitz lucky you are!) |
Hi,
maybe this is a stupid question, but I am currently not able to get oidc-client running with Azure Active Directory. To me it seems to be fine as the callback happens and has all parameters, but in my callback.html I constantly get the error no state in response.
I am using implicit flow, so my config looks like this:
var config = { authority: "https://login.microsoftonline.com/v2.0", client_id: "anyid", redirect_uri: "http://localhost:5003/callback.html", response_type: "id_token", scope: "openid profile", post_logout_redirect_uri: "http://localhost:5003/index.html" };
And my callback.html looks like this (taken from Identity Server JS Client example).
new Oidc.UserManager({response_mode:"query"}).signinRedirectCallback().then(function() { window.location = "index.html"; }).catch(function(e) { console.error(e); });
I don't know if the response_mode 'query' is necessary or if not, or if I have to use another response_mode. The callback looks like this
callback.html#id_token=verylongtoken&state=554e511e3972439e8355bffc52370a0f&session_state=37cd64fe-789f-4dda-a675-00530138ba36
Thanks
The text was updated successfully, but these errors were encountered: