Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
clients "github.com/auth0/go-auth0/management/management/clients"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &clients.PatchClientCredentialRequestContent{}
client.Clients.Credentials.Update(
context.TODO(),
"client_id",
"credential_id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.clients.credentials.update("client_id", "credential_id", {});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.clients.credentials.update("client_id", "credential_id", {});
}
main();curl --request PATCH \
--url https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}"
payload = { "expires_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_at' => '2023-11-07T05:31:56Z'
]),
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;
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"alg": "RS256",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "cred_1m7sfABoNTTKYwTQ8qt6tX",
"kid": "IZSSTECp...",
"name": "",
"subject_dn": "<string>",
"thumbprint_sha256": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Credential ID を指定して認証情報を更新
以前に作成したクライアント認証情報を変更します。有効または無効の場合があります。詳細は、Client Credential Flow を参照してください。
PATCH
https://{tenantDomain}/api/v2
/
clients
/
{client_id}
/
credentials
/
{credential_id}
Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
clients "github.com/auth0/go-auth0/management/management/clients"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &clients.PatchClientCredentialRequestContent{}
client.Clients.Credentials.Update(
context.TODO(),
"client_id",
"credential_id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.clients.credentials.update("client_id", "credential_id", {});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.clients.credentials.update("client_id", "credential_id", {});
}
main();curl --request PATCH \
--url https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}"
payload = { "expires_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_at' => '2023-11-07T05:31:56Z'
]),
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;
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/clients/{client_id}/credentials/{credential_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"alg": "RS256",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "cred_1m7sfABoNTTKYwTQ8qt6tX",
"kid": "IZSSTECp...",
"name": "",
"subject_dn": "<string>",
"thumbprint_sha256": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/jsonapplication/x-www-form-urlencoded
認証情報の有効期限を表す ISO 8601 形式の日付。
レスポンス
認証情報が正常に更新されました。
認証情報で使用されるアルゴリズム。サポートされるアルゴリズム: RS256,RS384,PS256
利用可能なオプション:
RS256, RS384, PS256 認証情報の作成日時を表す ISO 8601 形式の日付。
認証情報の種類。
利用可能なオプション:
public_key, cert_subject_dn, x509_cert 認証情報の有効期限を表す ISO 8601 形式の日付。
認証情報の ID。作成時に生成されます。
認証情報のキー識別子。作成時に生成されます。
ユーザーが認証情報に付けた名前。
X509 証明書のサブジェクト識別名
X509 証明書の SHA256 サムプリント
認証情報の更新日時を表す ISO 8601 形式の日付。
⌘I