C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.RefreshTokens.RevokeAsync(
new RevokeRefreshTokensRequestContent()
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.RevokeRefreshTokensRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.refreshTokens().revoke(
RevokeRefreshTokensRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\RefreshTokens\Requests\RevokeRefreshTokensRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->refreshTokens->revoke(
new RevokeRefreshTokensRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.refresh_tokens.revoke()
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.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>"
}
'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));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))
}リフレッシュトークンを取り消す
ID リスト、ユーザー、ユーザー+クライアント、またはユーザー+クライアント+audience を指定して、リフレッシュトークンを一括で取り消します。
POST
https://{tenantDomain}/api/v2
/
refresh-tokens
/
revoke
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.RefreshTokens.RevokeAsync(
new RevokeRefreshTokensRequestContent()
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.RevokeRefreshTokensRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.refreshTokens().revoke(
RevokeRefreshTokensRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\RefreshTokens\Requests\RevokeRefreshTokensRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->refreshTokens->revoke(
new RevokeRefreshTokensRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.refresh_tokens.revoke()
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.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>"
}
'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));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))
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
次の組み合わせのうち、必ず 1 つだけ指定する必要があります: ids(最大 100 個の token 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 の配列。一度に指定できるのは 100 個までです。
Minimum array length:
1Required string length:
1 - 30このユーザーのすべてのリフレッシュトークンを取り消します。
Required string length:
1 - 300レスポンス
リフレッシュトークンの取り消しリクエストを受け付けました。
⌘I