400 Bad Request Error when trying to logout

I’m getting 400 bad request error when trying to logout my app using the code on the documentation

HttpContext.GetOwinContext().Authentication.SignOut(
                CookieAuthenticationDefaults.AuthenticationType,
                OktaDefaults.MvcAuthenticationType);

this is the url that’s executing

https://login-qa.ny.gov/oauth2/default/v1/logout?post_logout_redirect_uri=https%3A%2F%2Fnewyorktest.myhousing.com%2Faccount%2Fpostlogout%20&id_token_hint=eyJraWQiOiI5blpGM0xPZnhRUnhDMkRKQWpvOWxsNjZmRmJ4NF9ULWNLakljS09MZjVFIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHU5cWhxY3M0Tkh3WjBMeTI5NyIsIm5hbWUiOiJHYWJyaWVsIFJvc2FzIiwidmVyIjoxLCJpc3MiOiJodHRwczovL2xvZ2luLXFhLm55Lmdvdi9vYXV0aDIvZGVmYXVsdCIsImF1ZCI6IjBvYTlpa2Rjc2lpbzlPN1lZMjk3IiwiaWF0IjoxNjMxODI3OTEyLCJleHAiOjE2MzE4MzE1MTIsImp0aSI6IklELmRrT3VwNldSUU4zSk1BRjl3VVZ3Z2QwQ2h2X1BqWmw1QXoyR1MtWi1OQmciLCJhbXIiOlsicHdkIl0sImlkcCI6IjBvYTJmenp0aGFoM3NnYm9pMjk3Iiwibm9uY2UiOiI2Mzc2NzQyNDcwMDY4MzIzNjcuWTJWaFlUQmlZalV0WTJZNFl5MDBPV0ptTFRoak1HWXRPRE13TmpVME9XUTVOall5TkRFNFpqYzBZamt0WWpBMFpDMDBOakZqTFdJeFl6SXROamc1TXpJd05UTTNaVGxsIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiZ3Jvc2FzIiwiYXV0aF90aW1lIjoxNjMxODI3OTEwLCJhdF9oYXNoIjoiODRuOGk4WjhvTzRyYkEwbjhDaWlUQSIsImxhc3ROYW1lIjoiUm9zYXMiLCJueXNzb2d1aWQiOiI4MmEzYTE4ZC00MDcwLTQ4YmQtOTA5NC1mZjkwM2M1MTQ5YzYiLCJmaXJzdE5hbWUiOiJHYWJyaWVsIiwiZW1haWxfY2xhaW0iOiJnYWJvLnJvc2VzQGdtYWlsLmNvbSIsIk9VIjoiUGVyc29uYWwiLCJvcmdhbml6YXRpb24iOiJQZXJzb25hbCIsIlVTRVJJRCI6Imdyb3NhcyIsIm1pZGRsZU5hbWUiOiIiLCJtaWRkbGVpbml0aWFsIjoiIiwidWlkX2NsYWltIjoiZ3Jvc2FzIn0.sO8mK_PzE7ESLvM0HB-khRwwWg9TuwCF1v-OQNx5v5zoAD7Uf59Nq0wXzLeUVlrEPpDb7_wRteQ_1kAigWN2mwn8GByVXrolj78L5aiRzNGRcs_yt6DF81gAQBdPnblZOjKuatnpO9RysTN9dO0fiWZjTMA1UYRJNhILgr3bMN0D89LKD1gWHJ1o2NIB7lzXRaiQobFYy2zVZibDVNq3geaujmSqUhCNjHcxWHuCS9aOeP_x4HEH408vy_v87AzkuDyuHCAIs5rbvXgmiJBBEcdGhN9U8TYTlYkt7MGGwoRxf5jtML7zmneu7tkpx-bAIcOyaBqJDXLfkQ8qhh2NCQ&x-client-SKU=ID_NET461&x-client-ver=5.3.0.0

this is my app configuration
config

Looks like you have a trailing space at the end of your post logout redirect uri, which is causing the error you see when you follow that link about the post_logout_redirect_uri being invalid.

Try this one instead (I removed %20 from the post_logout_redirect_uri parameter value): https://login-qa.ny.gov/oauth2/default/v1/logout?post_logout_redirect_uri=https%3A%2F%2Fnewyorktest.myhousing.com%2Faccount%2Fpostlogout&id_token_hint=eyJraWQiOiI5blpGM0xPZnhRUnhDMkRKQWpvOWxsNjZmRmJ4NF9ULWNLakljS09MZjVFIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHU5cWhxY3M0Tkh3WjBMeTI5NyIsIm5hbWUiOiJHYWJyaWVsIFJvc2FzIiwidmVyIjoxLCJpc3MiOiJodHRwczovL2xvZ2luLXFhLm55Lmdvdi9vYXV0aDIvZGVmYXVsdCIsImF1ZCI6IjBvYTlpa2Rjc2lpbzlPN1lZMjk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JBBEcdGhN9U8TYTlYkt7MGGwoRxf5jtML7zmneu7tkpx-bAIcOyaBqJDXLfkQ8qhh2NCQ&x-client-SKU=ID_NET461&x-client-ver=5.3.0.0

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.