Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Token Revocation

ยกเลิก token (access token หรือ refresh token) ตามมาตรฐาน RFC 7009 

Endpoint นี้ส่ง response ตรงตามมาตรฐาน RFC 7009 โดยไม่ wrap ใน {code, payload}

Endpoint

POST /oauth2/v1/revoke Content-Type: application/json Authorization: Basic base64(client_id:client_secret)

Request Headers

HeaderRequiredDescription
AuthorizationBasic base64(client_id:client_secret)
Content-Typeapplication/json

Request Parameters

ParameterTypeRequiredDescription
tokenstringToken ที่ต้องการ revoke (access_token หรือ refresh_token)
token_type_hintstringชนิดของ token

Response Format

Success Response (HTTP 200)

{}

ตามมาตรฐาน RFC 7009: ระบบจะส่ง HTTP 200 พร้อม {} เสมอ แม้ว่า token จะไม่ valid หรือหมดอายุแล้วก็ตาม

Error Response — Authentication Failed (HTTP 401)

HTTP/1.1 401 Unauthorized

Code Examples

curl -X POST https://auth.humansoft.co.th/oauth2/v1/revoke \ -H "Content-Type: application/json" \ -H "Authorization: Basic bXktYXBwOkNMSUVOVF9TRUNSRVQ=" \ -d '{"token": "TOKEN_TO_REVOKE"}'

Notes

  • การ revoke refresh token จะยกเลิก sessions ที่เกี่ยวข้องกับ user สำหรับ client นั้นด้วย
  • แม้ token จะไม่ valid ระบบก็จะส่ง HTTP 200 กลับมาเสมอ (ตามมาตรฐาน RFC 7009)
Last updated on