Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post logout doesn't call the redirect URI that is specified #60

Closed
xadvfh opened this issue Dec 21, 2020 · 8 comments
Closed

Post logout doesn't call the redirect URI that is specified #60

xadvfh opened this issue Dec 21, 2020 · 8 comments

Comments

@xadvfh
Copy link

xadvfh commented Dec 21, 2020

Here is what happens when my application logs out:

image

My application calls endSession with a post_logout_redirect_uri (post_logout_redirect_uri=https%3A%2F%2Flocalhost%3A52141%2Fsignout-callback-oidc). This redirect is never called.

@xadvfh
Copy link
Author

xadvfh commented Dec 21, 2020

My Client config has this:

    "RedirectUris": ["*"],
    "PostLogoutRedirectUris": ["*"],

Since wildcard works for RedirectUris I'm assuming it will work for PostLogoutRedirectUris also.

Here are the logs that are generated:

[15:35:54 Information] IdentityServer4.Validation.EndSessionRequestValidator
End session request validation success
{"ClientId": "mock-server-client-id", "ClientName": null, "SubjectId": "personal_user", "PostLogOutUri": "https://localhost:55735/signout-callback-oidc", "State": null, "Raw": {"id_token_hint": "***REDACTED***", "post_logout_redirect_uri": "https://localhost:55735/signout-callback-oidc"}, "$type": "EndSessionRequestValidationLog"}

[15:35:54 Debug] IdentityServer4.Endpoints.EndSessionEndpoint
Success validating end session request from mock-server-client-id

[15:35:55 Information] Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler
AuthenticationScheme: idsrv signed out.

[15:35:55 Debug] IdentityServer4.Hosting.IdentityServerMiddleware
SignOutCalled set; processing post-signout session cleanup.

[15:35:55 Debug] IdentityServer4.Stores.ValidatingClientStore
client configuration validation for client mock-server-client-id succeeded.

[15:35:55 Debug] IdentityServer4.Services.LogoutNotificationService
No client back-channel logout URLs

[15:35:55 Debug] IdentityServer4.Hosting.EndpointRouter
Request path /connect/endsession/callback matched to endpoint type Endsession

[15:35:55 Debug] IdentityServer4.Hosting.EndpointRouter
Endpoint enabled: Endsession, successfully created handler: IdentityServer4.Endpoints.EndSessionCallbackEndpoint

[15:35:55 Information] IdentityServer4.Hosting.IdentityServerMiddleware
Invoking IdentityServer endpoint: IdentityServer4.Endpoints.EndSessionCallbackEndpoint for /connect/endsession/callback

[15:35:55 Debug] IdentityServer4.Endpoints.EndSessionCallbackEndpoint
Processing signout callback request

[15:35:55 Debug] IdentityServer4.Stores.ValidatingClientStore
client configuration validation for client mock-server-client-id succeeded.

[15:35:55 Debug] IdentityServer4.Services.LogoutNotificationService
No client front-channel logout URLs

[15:35:55 Information] IdentityServer4.Endpoints.EndSessionCallbackEndpoint
Successful signout callback.

@xadvfh
Copy link
Author

xadvfh commented Dec 21, 2020

Maybe this is the fix: https://stackoverflow.com/a/53240640

@AleF83
Copy link
Contributor

AleF83 commented Dec 26, 2020

@xadvfh
Can you describe you flow?
As I see from your log, there is message "No client front-channel logout URLs".

So maybe you just should define FrontChannelLogoutUri property in your clients configuration env-var/file?

In any case, I've published new version of image (0.3.1) that allows you to configure AccountOptions (as described in the Stackoverflow link in you comment). See #63 for more details

@xadvfh
Copy link
Author

xadvfh commented Jan 6, 2021

@AleF83 it seems neither setting has worked for me.

If I specify the post logout redirect uri in PostLogoutRedirectUris it works fine. But it won't work with a wildcard. I see that support for wildcards was added in #44 and it works for RedirectUris but not for PostLogoutRedirectUris.

@AleF83
Copy link
Contributor

AleF83 commented Jan 6, 2021

Looks like there is bug here:

return Task.FromResult<bool>(client.RedirectUris.Any(allowedUri =>

It should be client.PostLogoutRedirectUris

I'll fix

@xadvfh
Copy link
Author

xadvfh commented Jan 6, 2021

thank you

@AleF83
Copy link
Contributor

AleF83 commented Jan 6, 2021

I've pushed new image version (0.3.2)

@xadvfh
Copy link
Author

xadvfh commented Jan 7, 2021

@AleF83 verified latest image woks great. Thank you!

@xadvfh xadvfh closed this as completed Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants