Arttii
Arttii15mo ago

How to get session id given userid and access token

Hi, I am using the NextAuth provider for Zitadel and wanted to implement a custom logout when a user is logged into Zitadel with multiple users. The /oidc/v1/end_session endpoint logs out all users, but I want to be able to logout only the current user used in the app. I was trying to do this by calling /v2beta/sessions/ with a DELETE, but I somehow cannot get the sessionid to use in that call. Help would be greatly appreciated!
6 Replies
Arttii
ArttiiOP15mo ago
Just doing signOut on the Provider level deletes the cookies, but the user can just log in again after that
FFO
FFO15mo ago
Hm @livio I guess we do not track sessions across these apis, right?
Arttii
ArttiiOP15mo ago
The docs seemed to indicate, that this is the way to go for it though
fabienne
fabienne15mo ago
the end session endpoint does always logout all users. and this is currently not compatible with our new session api. if you want to use the session api, you will have to make the authentication as well trhough the session api
Arttii
ArttiiOP15mo ago
Ah oke so not using the oidc and etc I see
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?