リフレッシュトークンを失効する
curl --request POST \
--url https://{tenantDomain}/api/v2/refresh-tokens/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": "<string>",
"client_id": "<string>",
"ids": [
"<string>"
],
"user_id": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/refresh-tokens/revoke"
payload = {
"audience": "<string>",
"client_id": "<string>",
"ids": ["<string>"],
"user_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience: '<string>',
client_id: '<string>',
ids: ['<string>'],
user_id: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/refresh-tokens/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/refresh-tokens/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience' => '<string>',
'client_id' => '<string>',
'ids' => [
'<string>'
],
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/refresh-tokens/revoke"
payload := strings.NewReader("{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/refresh-tokens/revoke")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/refresh-tokens/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyリフレッシュトークンの失効
ID リスト、ユーザー、ユーザー+クライアント、またはユーザー+クライアント+audience を指定して、リフレッシュトークンを一括で失効させます。
POST
https://{tenantDomain}/api/v2
/
refresh-tokens
/
revoke
リフレッシュトークンを失効する
curl --request POST \
--url https://{tenantDomain}/api/v2/refresh-tokens/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": "<string>",
"client_id": "<string>",
"ids": [
"<string>"
],
"user_id": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/refresh-tokens/revoke"
payload = {
"audience": "<string>",
"client_id": "<string>",
"ids": ["<string>"],
"user_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience: '<string>',
client_id: '<string>',
ids: ['<string>'],
user_id: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/refresh-tokens/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/refresh-tokens/revoke",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience' => '<string>',
'client_id' => '<string>',
'ids' => [
'<string>'
],
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/refresh-tokens/revoke"
payload := strings.NewReader("{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/refresh-tokens/revoke")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/refresh-tokens/revoke")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience\": \"<string>\",\n \"client_id\": \"<string>\",\n \"ids\": [\n \"<string>\"\n ],\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
次の組み合わせのうち、指定できるのは1つのみです: ids(最大100個のトークンID)、user_id、user_id + client_id、または user_id + client_id + audience。ids は user_id、client_id、audience と組み合わせることはできません。audience を指定するには、user_id と client_id の両方が必要です。client_id 単独での指定はできず、user_id と組み合わせる必要があります。
失効の対象範囲を指定するリソースサーバー識別子(audience)。user_id と client_id の両方と併せて使用する必要があります。
Required string length:
1 - 600このクライアントのリフレッシュトークンを失効します。user_id との組み合わせが必須で、必要に応じて audience でさらに絞り込めます。
Required string length:
1 - 64失効するリフレッシュトークン ID の配列。1 回につき 100 個までです。
Minimum array length:
1Required string length:
1 - 30このユーザーのすべてのリフレッシュトークンを失効します。
Required string length:
1 - 300レスポンス
リフレッシュトークンの失効リクエストが受理されました。
⌘I