AWS congnito giving me "redirect_mismatch"

Viewed 6807

Whenever I direct the browser to the Cognito logout endpoint with a redirect_uri of anything other than:

http://localhost:63882/signin-oidc

I get a "redirect_mismatch" error.

I am aware whatever I pass in redirect_uri needs to be in the list of configured callback URLs and sign_out URLs in teh Cognito control panel - this is set up.

So for example this won't work:

https://MY_POOL_NAME.auth.eu-west-2.amazoncognito.com/logout?response_type=code&client_id=MY_CLIENT_CODE&redirect_uri=http://localhost:63882/Protected&state=STATE&scope=openid+profile

This does:

https://MY_POOL_NAME.auth.eu-west-2.amazoncognito.com/logout?response_type=code&client_id=MY_CLIENT_CODE&redirect_uri=http://localhost:63882/signin-oidc&state=STATE&scope=openid+profile

What am I missing? My understanding is I should be able to set redirect_uri to any page that I want providing it is listed in the callback URLs in the control panel.

2 Answers

In my case I had the callback url set to http://... in the app client settings, but in a fiddler trace the callback url was https://... After changing the url in the client app settings to https://... I got the login page

Turns out signin-oidc is the default redirect set up by the middleware so unless you specifically change it you just need to have signin-oidc configured in Cognito callback URLs.

Related