Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
organizations "github.com/auth0/go-auth0/management/management/organizations"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &organizations.AssociateOrganizationClientGrantRequestContent{
GrantId: "grant_id",
}
client.Organizations.ClientGrants.Create(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.clientGrants.create("id", {
grantId: "grant_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.clientGrants.create("id", {
grantId: "grant_id",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/client-grants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_id": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations/{id}/client-grants"
payload = { "grant_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/organizations/{id}/client-grants",
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([
'grant_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;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/organizations/{id}/client-grants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"grant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations/{id}/client-grants")
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 \"grant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"allow_any_organization": true,
"audience": "<string>",
"client_id": "<string>",
"id": "<string>",
"scope": [
"<string>"
]
}組織のクライアントグラントを作成
POST
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
client-grants
Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
organizations "github.com/auth0/go-auth0/management/management/organizations"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &organizations.AssociateOrganizationClientGrantRequestContent{
GrantId: "grant_id",
}
client.Organizations.ClientGrants.Create(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.clientGrants.create("id", {
grantId: "grant_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.clientGrants.create("id", {
grantId: "grant_id",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/client-grants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_id": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations/{id}/client-grants"
payload = { "grant_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/organizations/{id}/client-grants",
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([
'grant_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;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/organizations/{id}/client-grants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"grant_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations/{id}/client-grants")
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 \"grant_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"allow_any_organization": true,
"audience": "<string>",
"client_id": "<string>",
"id": "<string>",
"scope": [
"<string>"
]
}承認
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
組織の識別子。
Maximum string length:
50ボディ
application/jsonapplication/x-www-form-urlencoded
組織に追加するクライアントグラント ID。
レスポンス
クライアントグラントが組織に正常に関連付けられました。
有効にすると、このグラントは任意の組織で使用できます。無効(デフォルト)の場合、このグラントは対象の組織に明示的に割り当てる必要があります。
このクライアントグラントのオーディエンス(API識別子)
Minimum string length:
1クライアントの ID。
クライアントグラントの ID。
このグラントで、クライアントクレデンシャル交換に組織を使用できるかどうかを定義します。
利用可能なオプション:
deny, allow, require このクライアントグラントで許可されるスコープ。
Minimum string length:
1⌘I