logto icon indicating copy to clipboard operation
logto copied to clipboard

bug: post sign-out uri is not working like docs say

Open terion-name opened this issue 6 months ago • 9 comments

Describe the bug

Docs section: https://docs.logto.io/end-user-flows/sign-out#clear-sign-in-session-at-logto

To explicitly sign out the user and clear the session at Logto, the client application need to redirect the user to the Logto's end session endpoint.

E.g. https://{your-logto-domain}/oidc/session/end

If a post-logout redirect URI is provided, the user will be redirected to the specified URI after the session is cleared. Otherwise, the user will be redirected to the default post-logout page hosted by Logto.

The OIDC app:

Image

But hitting http://auth.localhost:8000/oidc/session/end doesn't redirect where it should, it redirects to http://auth.localhost:8000/oidc/session/end/success

Nowhere in docs or google there is no info about any required flags, url params (like ?redirect_uri=, which doesn't work also)

Expected behavior

After logout user is redirected to uri provided in settings

How to reproduce?

Create an OIDC app, enter the required settings, go to /oidc/session/end

Environment

Self-hosted (Docker image)

Screenshots

No response

terion-name avatar Jul 03 '25 15:07 terion-name

Yes, similar to the sign-in request, you need to explicitly set the post_logout_redirect_uri in your /oidc/session/end request. If you're using one of our SDKs, the signOut method should support an optional postLogoutRedirectUri parameter.

simeng-li avatar Jul 04 '25 02:07 simeng-li

Yes, similar to the sign-in request, you need to explicitly set the post_logout_redirect_uri in your /oidc/session/end request. If you're using one of our SDKs, the signOut method should support an optional postLogoutRedirectUri parameter.

to explicitly set the post_logout_redirect_uri where and how? ?post_logout_redirect_uri=http://localhost:8000?

terion-name avatar Jul 04 '25 11:07 terion-name

Are you using any of the Logto SDKs in your application?

simeng-li avatar Jul 07 '25 03:07 simeng-li

Are you using any of the Logto SDKs in your application?

nope. auth is handled in oauth2 proxy

terion-name avatar Jul 13 '25 12:07 terion-name

Then yes, you will need to append ?post_logout_redirect_uri=http://localhost:8000 to your end session request.

simeng-li avatar Aug 07 '25 02:08 simeng-li

Then yes, you will need to append ?post_logout_redirect_uri=http://localhost:8000 to your end session request.

But I tried and this doesn't work. That's why the issue

terion-name avatar Aug 07 '25 19:08 terion-name

Could you please share the full details of the end-session request?

simeng-li avatar Aug 28 '25 05:08 simeng-li

Hi, I have the same issue, has anyone resolve the issue? the request url is http://:3001/oidc/session/end?post_logout_redirect_uri= I use window.top.location.href = logtoLogoutUrl to redirect to logto logout end seesion, but the browser stop at :3001/oidc/session/end/success page, it did not go to the callback page.

florasnowfang-debug avatar Oct 10 '25 11:10 florasnowfang-debug

my application is wikijs both of the following methods are ineffective for WikiJS, the browser stop at /oidc/session/end/success page .

Image Image

victimsss avatar Nov 03 '25 07:11 victimsss

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 04 '25 02:12 github-actions[bot]

Hi, I have the same issue, has anyone resolve the issue? the request url is http://:3001/oidc/session/end?post_logout_redirect_uri= I use window.top.location.href = logtoLogoutUrl to redirect to logto logout end seesion, but the browser stop at :3001/oidc/session/end/success page, it did not go to the callback page.

What value did you send for post_logout_redirect_uri in the end-session request?

simeng-li avatar Dec 04 '25 02:12 simeng-li

my application is wikijs both of the following methods are ineffective for WikiJS, the browser stop at /oidc/session/end/success page .

Image Image

Could you verify whether the LogoutUrl setting in Wiki.js supports query parameters?

simeng-li avatar Dec 04 '25 02:12 simeng-li

my application is wikijs both of the following methods are ineffective for WikiJS, the browser stop at /oidc/session/end/success page . Image Image

Could you verify whether the LogoutUrl setting in Wiki.js supports query parameters?

I am not entirely certain. I have just reviewed the source code at: https://github.com/requarks/wiki/blob/407aacfa19021f4b9b4cbaa24fc9524e359b876f/server/modules/authentication/oidc/authentication.js#L61

It appears that Wiki.js only supports a standard redirect. As a result, regardless of whether I include the post_logout_redirect_uri parameter in the Wiki.js logout URL, the process always remains on the /oidc/session/end/success page. This occurs even when Logto is configured to redirect to the Wiki.js homepage.

However, for certain specific providers—such as Keycloak or Auth0—Wiki.js does appear to forward additional parameters accordingly.

victimsss avatar Dec 04 '25 03:12 victimsss