Amplify-js: SignOut URL parameters redirect_uri

Created on 23 Jul 2018  路  7Comments  路  Source: aws-amplify/amplify-js

Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
SignOut with FederatedID sign in does not use the most up to date query string parameters that the current version of AWS Cognito uses

Example: https://example.us-east-1.amazoncognito.com/error?/logout?logout_uri=http%3A%2F%2Flocalhost%3A3000%2Fsignout&client_id=6546gfhfgdhhdfghdfhdf#

It is looking for the redirect_uri instead of logout_uri

Error Message for hosted UI Cognito: Required String parameter 'redirect_uri' is not present

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.

explained above in current behavior

What is the expected behavior?

should redirect back to specified redirected URI

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
Most updated/Chrome/Windows 10

question

Most helpful comment

for all of you facing this issue also with the url specified in the app client settings:
it worked for me only when the logout redirect url was different to the login one. (e.g. appending "/logout")

All 7 comments

Hi @Nickadiemus

I've seen similar behavior when the logout_uri is incorrectly escaped, e.g.

https://<example>.auth.us-east-1.amazoncognito.com/logout?logout_uri=http%3A%2F%2Flocalhost%3A3000%2Fsignout&client_id=dahQuePei7ahyez3eidahphei

vs

https://<example>.auth.us-east-1.amazoncognito.com/logout?logout_uri=http://localhost:3000&client_id=dahQuePei7ahyez3eidahphei

You can verify this if you see a couple of 302 redirects from:
/logout -> /login -> /error

screen shot 2018-07-24 at 3 08 00 pm

@manueliglesias Ahh I see. I understand that. When I was making this issue I was in a hurry so I didn't explain it very well. I apologize.

What I actually meant was, when I use the Auth.SignOut() function from the AuthClass, the function that builds the logout URI has the query string parameters with logout_uri and escapes the characters.

I guess this kind of poses two more questions (I can open another issue if needed)

  1. Is there a way to prevent the incorrectly escaped characters generated from the buildURL that aws-amplfy uses when calling the Auth.signOut() function?
  2. Is there a way to add a redirect_uri specifically when signing out with Auth.signOut() maybe with in the oauth scope when configuring Auth.conifgure({})

@manueliglesias should I start a new issue with my question?

@Nickadiemus
this error is because you didn't set Sign out URL(s) in the cognito user pool App client settings

for all of you facing this issue also with the url specified in the app client settings:
it worked for me only when the logout redirect url was different to the login one. (e.g. appending "/logout")

I can confirm that redirectSignOut: 'appname://' gives the above error. But redirectSignOut: 'appname://logout' works fine. So there must be a parsing bug in the Cognito backend expecting a path.

I found today that if the URL you have specified in the Console for Logout is different than the one you specify in the logout call it also fails.

It is interesting that in the documentation states "optional" and if you do not pass it crashes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdoesburg picture mdoesburg  路  65Comments

jmandivarapu1 picture jmandivarapu1  路  49Comments

guanzo picture guanzo  路  63Comments

nomadus picture nomadus  路  53Comments

kennu picture kennu  路  64Comments