Closed glicht closed 6 years ago
redirect is the uri used to go after auth signs-in/out, and it has to be the same uri that you use when you request the auth. It is like a contract to double check it is the right auth logic.
I would suggest to double check your settings vs your client config.
This is a working config:
private initCognitoSDK(){
let authData = {
ClientId : this.config.clientId, // Your client id here
AppWebDomain : this.config.appWebDomain,
TokenScopesArray : this.config.tokenScopesArray,
RedirectUriSignIn : this.config.redirectUriSignIn,
RedirectUriSignOut : this.config.redirectUriSignOut
};
return new AWSCognito.CognitoIdentityServiceProvider.CognitoAuth(authData);
}
And the example config:
{
"base_url": "https://localhost:3004/",
"clientId": "your_app_id_configured_at_the_console",
"appWebDomain": "your_project.auth.us-east-1.amazoncognito.com",
"tokenScopesArray": ["phone", "email", "profile","openid", "aws.cognito.signin.user.admin"],
"redirectUriSignIn": "https://localhost:3000/", // <- this has to match the App config in cognito.
"redirectUriSignOut": "https://localhost:3000/" // <- this has to match the App config in cognito.
}
*I would test this until getting a working example, then modify as needed.
Thanks. I got it working. I configured the logout url wrong in the user pool configuration (basically had a typo in the url).
The error message returned is such a case is really misleading and I think it can be improved.
Anyway, I am closing the issue.
When using /logout?client_id=
Required String parameter 'response_type' is not present
It should say:
Required String parameter 'logout_uri' is not present
Hi,
When user clicks on logout button, My code is as below to logout from cognito,
var xhttp = new XMLHttpRequest();
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
var url = "https://domain-name.auth.us-east-1.amazoncognito.com/logout?logout_uri=https://s3-eu-west-1.amazonaws.com/bucket-name/logout.html&client_id=
xhttp.open("GET", url, true); xhttp.send();
I am getting CORS issue when GET request is called.
Can anybody help me to fix this?
Thank you in advance!
I tried the same with Postman, I was able to redirect to the logout.html
Hi,
I am doing a simple test via the sample web page: https://github.com/aws/amazon-cognito-auth-js/tree/master/sample
I noticed that I am getting an error on signout. Signout is basically redirecting to a url of the following format:
https://<domain>.auth.us-east-1.amazoncognito.com/logout?logout_uri=<logouturl>&client_id=<client_id>
And then I get an error stating:
Required String parameter 'redirect_uri' is not present
I assume the redirect is used to clear the cookies, but it seems to be failing. I tried playing with this a bit by changing
logout_uri
toredirect_uri
but couldn't get it to redirect back to my logout uri.