> For the complete documentation index, see [llms.txt](https://developers.vinid.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.vinid.net/tai-lieu-tich-hop/tich-hop-vinid-sso/logout-endpoint.md).

# Logout endpoint

## /oauth2/sessions/logout

<mark style="color:blue;">`GET`</mark> `https://oauth-qc.vinid.dev/oauth2/sessions/logout`

#### Query Parameters

| Name                        | Type   | Description |
| --------------------------- | ------ | ----------- |
| post\_logout\_redirect\_uri | string |             |
| id\_token\_hint             | string |             |

{% tabs %}
{% tab title="302 Redirect to OneID" %}

```
```

{% endtab %}
{% endtabs %}

| Tham số                     | Định dạng | Mô tả                                              | Ví dụ |
| --------------------------- | --------- | -------------------------------------------------- | ----- |
| id\_token\_hint             | string    | id\_token                                          |       |
| post\_logout\_redirect\_uri | string    | Url để điều hướng tới sau khi logout thành công    |       |
| state                       | string    | Tham số ngẫu nhiên của post\_logout\_redirect\_uri |       |

![Logout sequence diagram](/files/-MGgEz9vlFnZxGvsksCX)

> post\_logout\_redirect\_uri = urlencode(<https://your\\_redirect\\_page?state=example>)

* frontchannel\_logout\_uri được sử dụng để OneID hủy token đối với frontend app.

```
GET https://yourapp.test/frontchannel_logout?iss=https://oauth-dev.vinid.dev/&sid=08a5019c-17e1-4977-8f42-65a12843ea02
```

* backchannel\_logout\_uri được sử dụng để OneID hủy token đối với backend app.

```
POST /backchannel_logout HTTP/1.1
Host: yourapp.test
Content-Type: application/x-www-form-urlencoded

logout_token=eyJhbGci ... .eyJpc3Mi ... .T3BlbklE ...
```
