Identityserver4: PostLogoutRedirectUri not work [Reopened]

Created on 22 Dec 2016  路  16Comments  路  Source: IdentityServer/IdentityServer4

I've set the PostLogoutRedirectUris in Client, and it cannot redirect to specific Url when logout.
I debug my code and got the value of PostLogoutRedirectUri from _interaction.GetLogoutContextAsync(model.LogoutId), but it's null.

How to fix this issue?

question

Most helpful comment

I was getting null in my logoutId string but I noticed in the log

IdentityServer4.Validation.EndSessionRequestValidator:Information: End session request validation failure: Invalid post logout URI

below I saw
"post_logout_redirect_uri": "http://localhost:3308/signout-callback-oidc"

I knew that my Post Logout Redirect Uri was set to http://localhost:3308/ which worked in older version of IdentityServer4. I changed my Post Logout Redirect Uri to http://localhost:3308/signout-callback-oidc and I suddenly had a value in my logoutId and my post logout redirection was working. It seems putting that signout-callback-oidc on the end of the base url fixed it for me.

All 16 comments

I have the same issue. What kind of flow do you use, the implicit one?

I used implicit and hybrid, both not work

Did you look at our samples to compare?

Certainly. My version is RC5
I've used Idsvr to did lots of things, but this issue I haven't fixed.

Ha Ha! I think I have found the root cause.
If set multiple Urls, like below:

RedirectUris = { "http://localhost:5002/signin-oidc", "http://localhost:5003/signin-oidc" },
PostLogoutRedirectUris = { "http://localhost:5002", "http://localhost:5003" },

It would not work. Once I removed either, it worked.
I was finding this issue when I did the testing of SSO (Single Sign On), Because I need multiple Urls to respond to different requests that are from different web portals.

You could reproduce this issue by this way.

It looks like you've resolved you issue, I think. I'll close. If you feel there's still a bug/issue with IdentityServer then please reopen.

What's your recommend for the SSO? Specify multiple clients correspond to different web request?
If you allow to input multiple redirects, you should coordinate the inter-logic and make it on the correct way that expect. Otherwise, I think it should be "Redirect", not "Redirects", it just be allowed to receive only one value, not an array. Does it make sense?

I've no permission to reopen it, please allow me to mark it reopened.

I have the same issue as OP, but in my case it doesn't always happen. For example I might log in and log out correctly, but if I log in again right away and try to log out, the model.LogoutId value is null.
I don't have multiple PostLogoutRedirectUris specified, it's just one.

Also sometimes during login, the url stays stuck at website/signin-oidc and doesn't redirect back. Both of the issues happen randomly though and there's no way I can reproduce them with 100% certainty to track down the problem.

I was getting null in my logoutId string but I noticed in the log

IdentityServer4.Validation.EndSessionRequestValidator:Information: End session request validation failure: Invalid post logout URI

below I saw
"post_logout_redirect_uri": "http://localhost:3308/signout-callback-oidc"

I knew that my Post Logout Redirect Uri was set to http://localhost:3308/ which worked in older version of IdentityServer4. I changed my Post Logout Redirect Uri to http://localhost:3308/signout-callback-oidc and I suddenly had a value in my logoutId and my post logout redirection was working. It seems putting that signout-callback-oidc on the end of the base url fixed it for me.

I knew that my Post Logout Redirect Uri was set to http://localhost:3308/ which worked in older version of IdentityServer4.

You mean older versions of the ASP.NET Core OpenID Connect middleware.

Was my fix the correct approach or is it a fudge and I am missing a more correct approach.

Sorry, I thought I was on another thread...

"~/signout-callback-oidc" is the correct value to use for ASP.NET Core 1.1 clients.

Are we all set on this issue? Can we close?

you can find the solution in this link:SO

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leksim picture leksim  路  3Comments

ekarlso picture ekarlso  路  3Comments

agilenut picture agilenut  路  3Comments

mackie1001 picture mackie1001  路  3Comments

wangkanai picture wangkanai  路  3Comments