400 Bad Request when trying to logout by redirecting

Have been facing issue with the logout even though the created urls is correct & it works fine without post_logout_redirect_uri.
But when that gets passed then its start returning 400 Bad Request specifying:
“Your request resulted in an error. The ‘post_logout_redirect_uri’ parameter must be a Logout redirect URI in the client app settings: https://…”.

I have check the redirect URI & I had it already in the Trusted Logout Redirect URI List, also checked for it for case-sensitivity but it is correctly mentioned.
I just don’t get it now why I’m getting this Error.

Neither,
https://trial-1805213.okta.com/logout?id_token_hint=${Correct_ID_Token}&post_logout_redirect_uri=http://localhost/somePath/#/logout&state=3edd6218e211b37f859be0aa4e1e6775

Nor,
https://trial-1805213.okta.com/oauth2/v1/logout?id_token_hint=${Correct_ID_Token}&post_logout_redirect_uri=http://localhost/somePath/#/logout&state=3edd6218e211b37f859be0aa4e1e6775

None of those works with “post_logout_redirect_uri”, but the 2nd URL mentioned work if just ID_Token is passed.

I have checked all following posts for reference & I have it all configured as its required, but still its not working:

  1. Configure Single Logout in app integrations | Okta
  2. Getting response 404 for OIDC Logout API call
  3. Logout fails with 400 bad request
  4. Logout 400 Bad Request (Logout URI already defined)

Hi @PersiAbhi,
It looks like your URI contains some special characters in it, have you tried URL-encoding the string before including it in the redirect to the /logout endpoint?

2 Likes