IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

PostLogoutRedirectUri not work [Reopened]

Open atpyk opened this issue 9 years ago • 16 comments

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?

atpyk avatar Dec 22 '16 08:12 atpyk

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

alessandroros avatar Dec 22 '16 11:12 alessandroros

I used implicit and hybrid, both not work

atpyk avatar Dec 23 '16 01:12 atpyk

Did you look at our samples to compare?

brockallen avatar Dec 23 '16 02:12 brockallen

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

atpyk avatar Dec 23 '16 05:12 atpyk

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.

atpyk avatar Dec 23 '16 08:12 atpyk

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.

brockallen avatar Dec 24 '16 02:12 brockallen

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?

atpyk avatar Dec 26 '16 01:12 atpyk

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

atpyk avatar Dec 26 '16 01:12 atpyk

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.

testaco23 avatar Jan 01 '17 22:01 testaco23

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.

ravetroll avatar Jan 04 '17 11:01 ravetroll

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.

brockallen avatar Jan 04 '17 13:01 brockallen

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

ravetroll avatar Jan 04 '17 14:01 ravetroll

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

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

brockallen avatar Jan 04 '17 14:01 brockallen

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

brockallen avatar Jan 06 '17 19:01 brockallen

you can find the solution in this link:SO

dayan2 avatar Jun 04 '18 09:06 dayan2

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.

lock[bot] avatar Jan 13 '20 08:01 lock[bot]