mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
<!-- Please inform yourself about the contribution guidelines on submitting a PR here: https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr. Take note of how PR/commit titles should be written and replace the template texts in the sections below. Don't remove any of the sections. It is important that the commit history clearly shows what is changed and why. Important: By submitting a contribution you agree to the terms from our Licensing Policy as described here: https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions. --> # Which Problems Are Solved partially #9342 # How the Problems Are Solved Name custom domain consistently in the docs according to https://github.com/zitadel/zitadel/issues/5888 # Additional Changes # Additional Context
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
When your user is done using your application and clicks on the logout button, you have to send a request to the terminate session endpoint.
|
|
[Terminate Session Documentation](/docs/apis/resources/session_service_v2/session-service-delete-session)
|
|
|
|
Sessions can be terminated by either:
|
|
- the authenticated user
|
|
- a manager, who is granted `session.delete` (e.g. ORG_OWNER) on the authenticated users organisation
|
|
- providing the current session_token in the body.
|
|
|
|
Terminating a session means to delete it.
|
|
If you try to read or update the session afterward, you will get an error that the Session does not exist or was terminated.
|
|
|
|
|
|
### Request for authenticated users or managers
|
|
|
|
Make sure that the provided token is from the authenticated user, resp. the manager:
|
|
|
|
```bash
|
|
curl --request DELETE \
|
|
--url https://${CUSTOM_DOMAIN}/v2/sessions/218480890961985793 \
|
|
--header 'Accept: application/json' \
|
|
--header 'Authorization: Bearer '"$TOKEN"''\
|
|
--header 'Content-Type: application/json'
|
|
```
|
|
|
|
### Request with session token
|
|
|
|
Send the session token in the body of the request:
|
|
|
|
```bash
|
|
curl --request DELETE \
|
|
--url https://${CUSTOM_DOMAIN}/v2/sessions/218480890961985793 \
|
|
--header 'Accept: application/json' \
|
|
--header 'Authorization: Bearer '"$TOKEN"''\
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"sessionToken": "blGKerGQPKv8jN21p6E9GB1B-vl6_EyKlvTd5UALu8-aQmjucgZxHSXJx3XMFTwT9_Y3VnbOo3gC_Q"
|
|
}'
|
|
```
|