mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-11 07:42:58 +03:00
🚀 Feature: Add Support for "end_session_endpoint" or Custom URL for Logging Out #381
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @computrav on GitHub.
Feature description
I successfully got Pocket ID working with Grist (https://getgrist.com), however I'm not able to fully sign out of the application. When I try to sign out, it appears to sign me out of Grist, but if I sign in again immediately from there, it authenticates against Pocket ID and auto-logs me in, since I'm still signed in with Pocket ID. Grist supports calling a "end_session_endpoint", but one is not configured for Pocket ID. I tried manually providing it as https://<domain where I'm running Pocket Id>/api/webauthn/logout -- which is where the Pocket Id UI POSTs to to logout, but it didn't work (I didn't expect it to, but tried anyhow).
I believe that if Pocket ID were to implement the
end_session_endpointor some other endpoint to logout, it would solve this issue. Is this something that can be implemented?PS -- for anyone else trying to get Pocket Id OIDC working with Grist, here's the basics:
https://<Grist Host>/oauth2/callbackGRIST_DEFAULT_EMAILenv variable is set to the same email address as your User profile within Pocket IDPitch
So that logging out from apps can optionally trigger a logout from Pocket ID.
@truncsphere commented on GitHub:
Adding my support for this. Lubelogger requires a logout URL for my OIDC provider if I disable password login.
@stonith404 commented on GitHub:
I've implemented the end session endpoint. Would you mind to test the
ghcr.io/pocket-id/pocket-id:developmentimage and let me know if everything works as expected?Make sure to add a "Logout Callback URL" first, if your client provides this endpoint:
Please also let me know if you see the following confirmation page or if you get redirected back to the client directly:
@cirrusflyer commented on GitHub:
+1
@etcg commented on GitHub:
I support this. I use Pingvin Share with Pocket ID, and if you disable password login and the start page in Pingvin, trying to log out immediately logs you back in. It’s basically the same issue (which seems to be fixed for other OIDC providers) described here: https://github.com/stonith404/pingvin-share/issues/598
@kmendell commented on GitHub:
@stonith404 I tested this, i did end up getting the Logout page, and then after which i got redirected to the Pocket ID Login screen. I did not set and logout call back urls, and the app i used to test did not rpovide them.
One thing ill note as well, we will need to add the /api/oidc/end-session string to the OIDC Client UI along with all the other urls, unless i just missed it when i was testing.
@stonith404 commented on GitHub:
@kmendell Oh yeah, I forgot to add the link to the OIDC client page, thanks.
Which OIDC client did you use for testing?
@kmendell commented on GitHub:
@stonith404 I used Portainer, as thats the only one i knew for a fact had a Logout Endpoint i could configure.
@stonith404 commented on GitHub:
Thanks @etcg. This was actually an issue of Pingvin Share but it should be fixed in the latest version. Sorry I should have mentioned that you have to rollback the migration before downgrading.
@stonith404 commented on GitHub:
@kmendell Alright thanks. It seems like Portainer doesn't ship the
id_token_hintparameter to Pocket ID so it's expected that the logout page is shown.@computrav, @truncsphere, @etcg and @cirrusflyer would you mind to test the development image with your services?
@etcg commented on GitHub:
I tested it with Pingvin Share, and I don’t think it works for me. My callback URL is: https://share.domain.com/api/oauth/callback/oidc. I haven’t set a logout callback URL. In Pingvin Share, I have the start page and password login disabled.
However, I encountered a new bug in the development version: When I am logged out of Pocket ID (subdomain: sso.domain.com) and try to access my Pingvin Share (subdomain: share.domain.com), I get redirected to the Pocket ID login as expected. After authorization, however, it does not redirect back to Pingvin Share; instead, it opens the Pocket ID account page. I can only access Pingvin Share by manually reopening it after logging into Pocket ID. The same with another service, no redirect back to the service.
EDIT: I can't downgrade back to the latest version. I get this error on the Pocket ID page: Something went wrong. A critical error occured. Please contact your administrator.
Logs:
EDIT 2: I restored the pocket-id.db from backup and it works again with the latest image.
@computrav commented on GitHub:
Hi everyone -- apologies for not getting a chance to test this before it was pushed out.
Nonetheless, I've just tested it with Grist, and it works great! When I went to sign out of Grist, it brought me to Pocket ID as expected, and asked me to confirm the sign-out. I don't know if that is "standard" OIDC behavior, but I liked the option to kind of cancel the sign-out. Once I clicked to confirm the sign out, I confirmed that I was indeed signed out of Grist as well.
Grist-Specific OIDC Configuration Notes:
GRIST_OIDC_IDP_END_SESSION_ENDPOINTenvironment variable. This is optional. I found that this did NOT need to be defined. I assume therefore that Grist is getting it from the Pocket ID /openid-configuration endpoint which is great.@stonith404 commented on GitHub:
Released in
v0.33.0.