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.AddOrganizationConnectionRequestContent{
ConnectionId: "connection_id",
}
client.Organizations.EnabledConnections.Add(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"is_signup_enabled": true,
"show_as_button": true
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections"
payload = {
"connection_id": "<string>",
"assign_membership_on_login": True,
"is_signup_enabled": True,
"show_as_button": True
}
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}/enabled_connections",
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([
'connection_id' => '<string>',
'assign_membership_on_login' => true,
'is_signup_enabled' => true,
'show_as_button' => true
]),
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}/enabled_connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"is_signup_enabled\": true,\n \"show_as_button\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections")
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 \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"is_signup_enabled\": true,\n \"show_as_button\": true\n}"
response = http.request(request)
puts response.read_body{
"assign_membership_on_login": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
},
"connection_id": "<string>",
"is_signup_enabled": true,
"show_as_button": true
}有効な接続を追加
指定した Organization に対して特定の接続を有効にします。接続を有効にするには、その接続がすでにテナント内に存在している必要があります。このアクションで接続を作成することはできません。
接続 は、Auth0 とユーザーソースとの関係を表します。使用できる接続タイプには、データベース、エンタープライズ、ソーシャルがあります。
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.AddOrganizationConnectionRequestContent{
ConnectionId: "connection_id",
}
client.Organizations.EnabledConnections.Add(
context.TODO(),
"id",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"is_signup_enabled": true,
"show_as_button": true
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections"
payload = {
"connection_id": "<string>",
"assign_membership_on_login": True,
"is_signup_enabled": True,
"show_as_button": True
}
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}/enabled_connections",
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([
'connection_id' => '<string>',
'assign_membership_on_login' => true,
'is_signup_enabled' => true,
'show_as_button' => true
]),
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}/enabled_connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"is_signup_enabled\": true,\n \"show_as_button\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections")
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 \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"is_signup_enabled\": true,\n \"show_as_button\": true\n}"
response = http.request(request)
puts response.read_body{
"assign_membership_on_login": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
},
"connection_id": "<string>",
"is_signup_enabled": true,
"show_as_button": true
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
組織の識別子。
50ボディ
組織に追加する単一の接続 ID。
true の場合、この接続でログインするすべてのユーザーに組織のメンバーシップが自動的に付与されます。false の場合、この接続でログインする前に、ユーザーに組織のメンバーシップを付与しておく必要があります。
この組織接続で組織のサインアップを有効にするかどうかを指定します。データベース接続にのみ適用されます。デフォルト: false。
この組織のログインプロンプトに接続を表示するかどうかを指定します。エンタープライズ接続にのみ適用されます。デフォルト: true。
レスポンス
Organization の接続が正常に追加されました。
true の場合、この接続でログインするすべてのユーザーに組織のメンバーシップが自動的に付与されます。false の場合、この接続でログインする前に、ユーザーに組織のメンバーシップを付与しておく必要があります。
Show child attributes
Show child attributes
接続の ID。
この組織接続で組織のサインアップを有効にするかどうかを指定します。データベース接続にのみ適用されます。デフォルト: false。
この組織のログインプロンプトに接続を表示するかどうかを指定します。エンタープライズ接続にのみ適用されます。デフォルト: true。