# 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 ...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.vinid.net/tai-lieu-tich-hop/tich-hop-vinid-sso/logout-endpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
