package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateConnectionRequestContent{
Name: "name",
Strategy: management.ConnectionIdentityProviderEnumAd,
}
client.Connections.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.connections.create({
name: "name",
strategy: "ad",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.connections.create({
name: "name",
strategy: "ad",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"options": {
"api_enable_groups": true,
"api_enable_users": true,
"attributes": {
"email": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
},
"unique": true
},
"phone_number": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"username": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {},
"validation": {
"allowed_types": {
"email": true,
"phone_number": true
},
"max_length": 64.5,
"min_length": 64.5
}
}
},
"authentication_methods": {
"email_otp": {
"enabled": true
},
"passkey": {
"enabled": true
},
"password": {
"enabled": true
},
"phone_otp": {
"enabled": true
}
},
"basic_profile": true,
"configuration": {},
"customScripts": {
"change_email": "<string>",
"change_password": "<string>",
"change_phone_number": "<string>",
"change_username": "<string>",
"create": "<string>",
"delete": "<string>",
"get_user": "<string>",
"login": "<string>",
"verify": "<string>"
},
"disable_self_service_change_password": true,
"enable_script_context": true,
"enabledDatabaseCustomization": true,
"ext_admin": true,
"ext_agreed_terms": true,
"ext_assigned_plans": true,
"ext_groups": true,
"ext_is_suspended": true,
"ext_profile": true,
"federated_connections_access_tokens": {
"active": true
},
"gateway_authentication": {
"audience": "<string>",
"method": "<string>",
"secret": "<string>",
"secret_base64_encoded": true,
"subject": "<string>"
},
"id_token_session_expiry_supported": true,
"id_token_signed_response_algs": [],
"import_mode": true,
"non_persistent_attrs": [
"<string>"
],
"passkey_options": {
"local_enrollment_enabled": true,
"progressive_enrollment_enabled": true
},
"password_complexity_options": {
"min_length": 64
},
"password_dictionary": {
"enable": true,
"dictionary": [
"<string>"
]
},
"password_history": {
"enable": true,
"size": 12
},
"password_no_personal_info": {
"enable": true
},
"password_options": {
"complexity": {
"character_types": [],
"min_length": 36
},
"dictionary": {
"active": true,
"custom": [
"<string>"
]
},
"history": {
"active": true,
"size": 12
},
"profile_data": {
"active": true,
"blocked_fields": [
"<string>"
]
}
},
"precedence": [],
"set_user_root_attributes": "on_each_login",
"upstream_params": {},
"validation": {
"username": {
"max": 123,
"min": 2
}
}
},
"realms": [
"<string>"
],
"show_as_button": true
}
'import requests
url = "https://{tenantDomain}/api/v2/connections"
payload = {
"name": "<string>",
"display_name": "<string>",
"enabled_clients": ["<string>"],
"is_domain_connection": True,
"metadata": {},
"options": {
"api_enable_groups": True,
"api_enable_users": True,
"attributes": {
"email": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } },
"unique": True
},
"phone_number": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"username": {
"identifier": { "active": True },
"profile_required": True,
"signup": {},
"validation": {
"allowed_types": {
"email": True,
"phone_number": True
},
"max_length": 64.5,
"min_length": 64.5
}
}
},
"authentication_methods": {
"email_otp": { "enabled": True },
"passkey": { "enabled": True },
"password": { "enabled": True },
"phone_otp": { "enabled": True }
},
"basic_profile": True,
"configuration": {},
"customScripts": {
"change_email": "<string>",
"change_password": "<string>",
"change_phone_number": "<string>",
"change_username": "<string>",
"create": "<string>",
"delete": "<string>",
"get_user": "<string>",
"login": "<string>",
"verify": "<string>"
},
"disable_self_service_change_password": True,
"enable_script_context": True,
"enabledDatabaseCustomization": True,
"ext_admin": True,
"ext_agreed_terms": True,
"ext_assigned_plans": True,
"ext_groups": True,
"ext_is_suspended": True,
"ext_profile": True,
"federated_connections_access_tokens": { "active": True },
"gateway_authentication": {
"audience": "<string>",
"method": "<string>",
"secret": "<string>",
"secret_base64_encoded": True,
"subject": "<string>"
},
"id_token_session_expiry_supported": True,
"id_token_signed_response_algs": [],
"import_mode": True,
"non_persistent_attrs": ["<string>"],
"passkey_options": {
"local_enrollment_enabled": True,
"progressive_enrollment_enabled": True
},
"password_complexity_options": { "min_length": 64 },
"password_dictionary": {
"enable": True,
"dictionary": ["<string>"]
},
"password_history": {
"enable": True,
"size": 12
},
"password_no_personal_info": { "enable": True },
"password_options": {
"complexity": {
"character_types": [],
"min_length": 36
},
"dictionary": {
"active": True,
"custom": ["<string>"]
},
"history": {
"active": True,
"size": 12
},
"profile_data": {
"active": True,
"blocked_fields": ["<string>"]
}
},
"precedence": [],
"set_user_root_attributes": "on_each_login",
"upstream_params": {},
"validation": { "username": {
"max": 123,
"min": 2
} }
},
"realms": ["<string>"],
"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/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([
'name' => '<string>',
'display_name' => '<string>',
'enabled_clients' => [
'<string>'
],
'is_domain_connection' => true,
'metadata' => [
],
'options' => [
'api_enable_groups' => true,
'api_enable_users' => true,
'attributes' => [
'email' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
],
'unique' => true
],
'phone_number' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'username' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
],
'validation' => [
'allowed_types' => [
'email' => true,
'phone_number' => true
],
'max_length' => 64.5,
'min_length' => 64.5
]
]
],
'authentication_methods' => [
'email_otp' => [
'enabled' => true
],
'passkey' => [
'enabled' => true
],
'password' => [
'enabled' => true
],
'phone_otp' => [
'enabled' => true
]
],
'basic_profile' => true,
'configuration' => [
],
'customScripts' => [
'change_email' => '<string>',
'change_password' => '<string>',
'change_phone_number' => '<string>',
'change_username' => '<string>',
'create' => '<string>',
'delete' => '<string>',
'get_user' => '<string>',
'login' => '<string>',
'verify' => '<string>'
],
'disable_self_service_change_password' => true,
'enable_script_context' => true,
'enabledDatabaseCustomization' => true,
'ext_admin' => true,
'ext_agreed_terms' => true,
'ext_assigned_plans' => true,
'ext_groups' => true,
'ext_is_suspended' => true,
'ext_profile' => true,
'federated_connections_access_tokens' => [
'active' => true
],
'gateway_authentication' => [
'audience' => '<string>',
'method' => '<string>',
'secret' => '<string>',
'secret_base64_encoded' => true,
'subject' => '<string>'
],
'id_token_session_expiry_supported' => true,
'id_token_signed_response_algs' => [
],
'import_mode' => true,
'non_persistent_attrs' => [
'<string>'
],
'passkey_options' => [
'local_enrollment_enabled' => true,
'progressive_enrollment_enabled' => true
],
'password_complexity_options' => [
'min_length' => 64
],
'password_dictionary' => [
'enable' => true,
'dictionary' => [
'<string>'
]
],
'password_history' => [
'enable' => true,
'size' => 12
],
'password_no_personal_info' => [
'enable' => true
],
'password_options' => [
'complexity' => [
'character_types' => [
],
'min_length' => 36
],
'dictionary' => [
'active' => true,
'custom' => [
'<string>'
]
],
'history' => [
'active' => true,
'size' => 12
],
'profile_data' => [
'active' => true,
'blocked_fields' => [
'<string>'
]
]
],
'precedence' => [
],
'set_user_root_attributes' => 'on_each_login',
'upstream_params' => [
],
'validation' => [
'username' => [
'max' => 123,
'min' => 2
]
]
],
'realms' => [
'<string>'
],
'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/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"metadata\": {},\n \"options\": {\n \"api_enable_groups\": true,\n \"api_enable_users\": true,\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n },\n \"unique\": true\n },\n \"phone_number\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\n },\n \"username\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {},\n \"validation\": {\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n },\n \"max_length\": 64.5,\n \"min_length\": 64.5\n }\n }\n },\n \"authentication_methods\": {\n \"email_otp\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"password\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"basic_profile\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"change_email\": \"<string>\",\n \"change_password\": \"<string>\",\n \"change_phone_number\": \"<string>\",\n \"change_username\": \"<string>\",\n \"create\": \"<string>\",\n \"delete\": \"<string>\",\n \"get_user\": \"<string>\",\n \"login\": \"<string>\",\n \"verify\": \"<string>\"\n },\n \"disable_self_service_change_password\": true,\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"ext_admin\": true,\n \"ext_agreed_terms\": true,\n \"ext_assigned_plans\": true,\n \"ext_groups\": true,\n \"ext_is_suspended\": true,\n \"ext_profile\": true,\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"gateway_authentication\": {\n \"audience\": \"<string>\",\n \"method\": \"<string>\",\n \"secret\": \"<string>\",\n \"secret_base64_encoded\": true,\n \"subject\": \"<string>\"\n },\n \"id_token_session_expiry_supported\": true,\n \"id_token_signed_response_algs\": [],\n \"import_mode\": true,\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"passkey_options\": {\n \"local_enrollment_enabled\": true,\n \"progressive_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"character_types\": [],\n \"min_length\": 36\n },\n \"dictionary\": {\n \"active\": true,\n \"custom\": [\n \"<string>\"\n ]\n },\n \"history\": {\n \"active\": true,\n \"size\": 12\n },\n \"profile_data\": {\n \"active\": true,\n \"blocked_fields\": [\n \"<string>\"\n ]\n }\n },\n \"precedence\": [],\n \"set_user_root_attributes\": \"on_each_login\",\n \"upstream_params\": {},\n \"validation\": {\n \"username\": {\n \"max\": 123,\n \"min\": 2\n }\n }\n },\n \"realms\": [\n \"<string>\"\n ],\n \"show_as_button\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/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 \"name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"metadata\": {},\n \"options\": {\n \"api_enable_groups\": true,\n \"api_enable_users\": true,\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n },\n \"unique\": true\n },\n \"phone_number\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\n },\n \"username\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {},\n \"validation\": {\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n },\n \"max_length\": 64.5,\n \"min_length\": 64.5\n }\n }\n },\n \"authentication_methods\": {\n \"email_otp\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"password\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"basic_profile\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"change_email\": \"<string>\",\n \"change_password\": \"<string>\",\n \"change_phone_number\": \"<string>\",\n \"change_username\": \"<string>\",\n \"create\": \"<string>\",\n \"delete\": \"<string>\",\n \"get_user\": \"<string>\",\n \"login\": \"<string>\",\n \"verify\": \"<string>\"\n },\n \"disable_self_service_change_password\": true,\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"ext_admin\": true,\n \"ext_agreed_terms\": true,\n \"ext_assigned_plans\": true,\n \"ext_groups\": true,\n \"ext_is_suspended\": true,\n \"ext_profile\": true,\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"gateway_authentication\": {\n \"audience\": \"<string>\",\n \"method\": \"<string>\",\n \"secret\": \"<string>\",\n \"secret_base64_encoded\": true,\n \"subject\": \"<string>\"\n },\n \"id_token_session_expiry_supported\": true,\n \"id_token_signed_response_algs\": [],\n \"import_mode\": true,\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"passkey_options\": {\n \"local_enrollment_enabled\": true,\n \"progressive_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"character_types\": [],\n \"min_length\": 36\n },\n \"dictionary\": {\n \"active\": true,\n \"custom\": [\n \"<string>\"\n ]\n },\n \"history\": {\n \"active\": true,\n \"size\": 12\n },\n \"profile_data\": {\n \"active\": true,\n \"blocked_fields\": [\n \"<string>\"\n ]\n }\n },\n \"precedence\": [],\n \"set_user_root_attributes\": \"on_each_login\",\n \"upstream_params\": {},\n \"validation\": {\n \"username\": {\n \"max\": 123,\n \"min\": 2\n }\n }\n },\n \"realms\": [\n \"<string>\"\n ],\n \"show_as_button\": true\n}"
response = http.request(request)
puts response.read_body{
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"id": "con_0000000000000001",
"is_domain_connection": true,
"metadata": {},
"name": "My connection",
"options": {},
"realms": [
"<string>"
],
"show_as_button": true,
"strategy": "auth0"
}接続を作成
body で受け取った JSON オブジェクトに基づいて、新しい接続を作成します。
注: 同じ名前の接続が最近削除されており、関連付けられたユーザー数が多い場合は、削除処理がまだ進行中である可能性があります。削除が完了する前にその名前で新しい接続を作成すると、失敗したり、予期しない結果が生じたりすることがあります。
package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateConnectionRequestContent{
Name: "name",
Strategy: management.ConnectionIdentityProviderEnumAd,
}
client.Connections.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.connections.create({
name: "name",
strategy: "ad",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.connections.create({
name: "name",
strategy: "ad",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"metadata": {},
"options": {
"api_enable_groups": true,
"api_enable_users": true,
"attributes": {
"email": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
},
"unique": true
},
"phone_number": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"username": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {},
"validation": {
"allowed_types": {
"email": true,
"phone_number": true
},
"max_length": 64.5,
"min_length": 64.5
}
}
},
"authentication_methods": {
"email_otp": {
"enabled": true
},
"passkey": {
"enabled": true
},
"password": {
"enabled": true
},
"phone_otp": {
"enabled": true
}
},
"basic_profile": true,
"configuration": {},
"customScripts": {
"change_email": "<string>",
"change_password": "<string>",
"change_phone_number": "<string>",
"change_username": "<string>",
"create": "<string>",
"delete": "<string>",
"get_user": "<string>",
"login": "<string>",
"verify": "<string>"
},
"disable_self_service_change_password": true,
"enable_script_context": true,
"enabledDatabaseCustomization": true,
"ext_admin": true,
"ext_agreed_terms": true,
"ext_assigned_plans": true,
"ext_groups": true,
"ext_is_suspended": true,
"ext_profile": true,
"federated_connections_access_tokens": {
"active": true
},
"gateway_authentication": {
"audience": "<string>",
"method": "<string>",
"secret": "<string>",
"secret_base64_encoded": true,
"subject": "<string>"
},
"id_token_session_expiry_supported": true,
"id_token_signed_response_algs": [],
"import_mode": true,
"non_persistent_attrs": [
"<string>"
],
"passkey_options": {
"local_enrollment_enabled": true,
"progressive_enrollment_enabled": true
},
"password_complexity_options": {
"min_length": 64
},
"password_dictionary": {
"enable": true,
"dictionary": [
"<string>"
]
},
"password_history": {
"enable": true,
"size": 12
},
"password_no_personal_info": {
"enable": true
},
"password_options": {
"complexity": {
"character_types": [],
"min_length": 36
},
"dictionary": {
"active": true,
"custom": [
"<string>"
]
},
"history": {
"active": true,
"size": 12
},
"profile_data": {
"active": true,
"blocked_fields": [
"<string>"
]
}
},
"precedence": [],
"set_user_root_attributes": "on_each_login",
"upstream_params": {},
"validation": {
"username": {
"max": 123,
"min": 2
}
}
},
"realms": [
"<string>"
],
"show_as_button": true
}
'import requests
url = "https://{tenantDomain}/api/v2/connections"
payload = {
"name": "<string>",
"display_name": "<string>",
"enabled_clients": ["<string>"],
"is_domain_connection": True,
"metadata": {},
"options": {
"api_enable_groups": True,
"api_enable_users": True,
"attributes": {
"email": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } },
"unique": True
},
"phone_number": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"username": {
"identifier": { "active": True },
"profile_required": True,
"signup": {},
"validation": {
"allowed_types": {
"email": True,
"phone_number": True
},
"max_length": 64.5,
"min_length": 64.5
}
}
},
"authentication_methods": {
"email_otp": { "enabled": True },
"passkey": { "enabled": True },
"password": { "enabled": True },
"phone_otp": { "enabled": True }
},
"basic_profile": True,
"configuration": {},
"customScripts": {
"change_email": "<string>",
"change_password": "<string>",
"change_phone_number": "<string>",
"change_username": "<string>",
"create": "<string>",
"delete": "<string>",
"get_user": "<string>",
"login": "<string>",
"verify": "<string>"
},
"disable_self_service_change_password": True,
"enable_script_context": True,
"enabledDatabaseCustomization": True,
"ext_admin": True,
"ext_agreed_terms": True,
"ext_assigned_plans": True,
"ext_groups": True,
"ext_is_suspended": True,
"ext_profile": True,
"federated_connections_access_tokens": { "active": True },
"gateway_authentication": {
"audience": "<string>",
"method": "<string>",
"secret": "<string>",
"secret_base64_encoded": True,
"subject": "<string>"
},
"id_token_session_expiry_supported": True,
"id_token_signed_response_algs": [],
"import_mode": True,
"non_persistent_attrs": ["<string>"],
"passkey_options": {
"local_enrollment_enabled": True,
"progressive_enrollment_enabled": True
},
"password_complexity_options": { "min_length": 64 },
"password_dictionary": {
"enable": True,
"dictionary": ["<string>"]
},
"password_history": {
"enable": True,
"size": 12
},
"password_no_personal_info": { "enable": True },
"password_options": {
"complexity": {
"character_types": [],
"min_length": 36
},
"dictionary": {
"active": True,
"custom": ["<string>"]
},
"history": {
"active": True,
"size": 12
},
"profile_data": {
"active": True,
"blocked_fields": ["<string>"]
}
},
"precedence": [],
"set_user_root_attributes": "on_each_login",
"upstream_params": {},
"validation": { "username": {
"max": 123,
"min": 2
} }
},
"realms": ["<string>"],
"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/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([
'name' => '<string>',
'display_name' => '<string>',
'enabled_clients' => [
'<string>'
],
'is_domain_connection' => true,
'metadata' => [
],
'options' => [
'api_enable_groups' => true,
'api_enable_users' => true,
'attributes' => [
'email' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
],
'unique' => true
],
'phone_number' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'username' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
],
'validation' => [
'allowed_types' => [
'email' => true,
'phone_number' => true
],
'max_length' => 64.5,
'min_length' => 64.5
]
]
],
'authentication_methods' => [
'email_otp' => [
'enabled' => true
],
'passkey' => [
'enabled' => true
],
'password' => [
'enabled' => true
],
'phone_otp' => [
'enabled' => true
]
],
'basic_profile' => true,
'configuration' => [
],
'customScripts' => [
'change_email' => '<string>',
'change_password' => '<string>',
'change_phone_number' => '<string>',
'change_username' => '<string>',
'create' => '<string>',
'delete' => '<string>',
'get_user' => '<string>',
'login' => '<string>',
'verify' => '<string>'
],
'disable_self_service_change_password' => true,
'enable_script_context' => true,
'enabledDatabaseCustomization' => true,
'ext_admin' => true,
'ext_agreed_terms' => true,
'ext_assigned_plans' => true,
'ext_groups' => true,
'ext_is_suspended' => true,
'ext_profile' => true,
'federated_connections_access_tokens' => [
'active' => true
],
'gateway_authentication' => [
'audience' => '<string>',
'method' => '<string>',
'secret' => '<string>',
'secret_base64_encoded' => true,
'subject' => '<string>'
],
'id_token_session_expiry_supported' => true,
'id_token_signed_response_algs' => [
],
'import_mode' => true,
'non_persistent_attrs' => [
'<string>'
],
'passkey_options' => [
'local_enrollment_enabled' => true,
'progressive_enrollment_enabled' => true
],
'password_complexity_options' => [
'min_length' => 64
],
'password_dictionary' => [
'enable' => true,
'dictionary' => [
'<string>'
]
],
'password_history' => [
'enable' => true,
'size' => 12
],
'password_no_personal_info' => [
'enable' => true
],
'password_options' => [
'complexity' => [
'character_types' => [
],
'min_length' => 36
],
'dictionary' => [
'active' => true,
'custom' => [
'<string>'
]
],
'history' => [
'active' => true,
'size' => 12
],
'profile_data' => [
'active' => true,
'blocked_fields' => [
'<string>'
]
]
],
'precedence' => [
],
'set_user_root_attributes' => 'on_each_login',
'upstream_params' => [
],
'validation' => [
'username' => [
'max' => 123,
'min' => 2
]
]
],
'realms' => [
'<string>'
],
'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/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"metadata\": {},\n \"options\": {\n \"api_enable_groups\": true,\n \"api_enable_users\": true,\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n },\n \"unique\": true\n },\n \"phone_number\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\n },\n \"username\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {},\n \"validation\": {\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n },\n \"max_length\": 64.5,\n \"min_length\": 64.5\n }\n }\n },\n \"authentication_methods\": {\n \"email_otp\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"password\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"basic_profile\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"change_email\": \"<string>\",\n \"change_password\": \"<string>\",\n \"change_phone_number\": \"<string>\",\n \"change_username\": \"<string>\",\n \"create\": \"<string>\",\n \"delete\": \"<string>\",\n \"get_user\": \"<string>\",\n \"login\": \"<string>\",\n \"verify\": \"<string>\"\n },\n \"disable_self_service_change_password\": true,\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"ext_admin\": true,\n \"ext_agreed_terms\": true,\n \"ext_assigned_plans\": true,\n \"ext_groups\": true,\n \"ext_is_suspended\": true,\n \"ext_profile\": true,\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"gateway_authentication\": {\n \"audience\": \"<string>\",\n \"method\": \"<string>\",\n \"secret\": \"<string>\",\n \"secret_base64_encoded\": true,\n \"subject\": \"<string>\"\n },\n \"id_token_session_expiry_supported\": true,\n \"id_token_signed_response_algs\": [],\n \"import_mode\": true,\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"passkey_options\": {\n \"local_enrollment_enabled\": true,\n \"progressive_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"character_types\": [],\n \"min_length\": 36\n },\n \"dictionary\": {\n \"active\": true,\n \"custom\": [\n \"<string>\"\n ]\n },\n \"history\": {\n \"active\": true,\n \"size\": 12\n },\n \"profile_data\": {\n \"active\": true,\n \"blocked_fields\": [\n \"<string>\"\n ]\n }\n },\n \"precedence\": [],\n \"set_user_root_attributes\": \"on_each_login\",\n \"upstream_params\": {},\n \"validation\": {\n \"username\": {\n \"max\": 123,\n \"min\": 2\n }\n }\n },\n \"realms\": [\n \"<string>\"\n ],\n \"show_as_button\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/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 \"name\": \"<string>\",\n \"display_name\": \"<string>\",\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"metadata\": {},\n \"options\": {\n \"api_enable_groups\": true,\n \"api_enable_users\": true,\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n },\n \"unique\": true\n },\n \"phone_number\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\n },\n \"username\": {\n \"identifier\": {\n \"active\": true\n },\n \"profile_required\": true,\n \"signup\": {},\n \"validation\": {\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n },\n \"max_length\": 64.5,\n \"min_length\": 64.5\n }\n }\n },\n \"authentication_methods\": {\n \"email_otp\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"password\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"basic_profile\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"change_email\": \"<string>\",\n \"change_password\": \"<string>\",\n \"change_phone_number\": \"<string>\",\n \"change_username\": \"<string>\",\n \"create\": \"<string>\",\n \"delete\": \"<string>\",\n \"get_user\": \"<string>\",\n \"login\": \"<string>\",\n \"verify\": \"<string>\"\n },\n \"disable_self_service_change_password\": true,\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"ext_admin\": true,\n \"ext_agreed_terms\": true,\n \"ext_assigned_plans\": true,\n \"ext_groups\": true,\n \"ext_is_suspended\": true,\n \"ext_profile\": true,\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"gateway_authentication\": {\n \"audience\": \"<string>\",\n \"method\": \"<string>\",\n \"secret\": \"<string>\",\n \"secret_base64_encoded\": true,\n \"subject\": \"<string>\"\n },\n \"id_token_session_expiry_supported\": true,\n \"id_token_signed_response_algs\": [],\n \"import_mode\": true,\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"passkey_options\": {\n \"local_enrollment_enabled\": true,\n \"progressive_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"character_types\": [],\n \"min_length\": 36\n },\n \"dictionary\": {\n \"active\": true,\n \"custom\": [\n \"<string>\"\n ]\n },\n \"history\": {\n \"active\": true,\n \"size\": 12\n },\n \"profile_data\": {\n \"active\": true,\n \"blocked_fields\": [\n \"<string>\"\n ]\n }\n },\n \"precedence\": [],\n \"set_user_root_attributes\": \"on_each_login\",\n \"upstream_params\": {},\n \"validation\": {\n \"username\": {\n \"max\": 123,\n \"min\": 2\n }\n }\n },\n \"realms\": [\n \"<string>\"\n ],\n \"show_as_button\": true\n}"
response = http.request(request)
puts response.read_body{
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
},
"display_name": "<string>",
"enabled_clients": [
"<string>"
],
"id": "con_0000000000000001",
"is_domain_connection": true,
"metadata": {},
"name": "My connection",
"options": {},
"realms": [
"<string>"
],
"show_as_button": true,
"strategy": "auth0"
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
接続の名前です。先頭と末尾は英数字である必要があり、使用できる文字は英数字と - のみです。最大長は 128 です。
128^[a-zA-Z0-9](-[a-zA-Z0-9]|[a-zA-Z0-9])*$接続の IDプロバイダー識別子
ad, adfs, amazon, apple, dropbox, bitbucket, auth0-oidc, auth0, baidu, bitly, box, custom, daccount, dwolla, email, evernote-sandbox, evernote, exact, facebook, fitbit, github, google-apps, google-oauth2, instagram, ip, line, linkedin, oauth1, oauth2, office365, oidc, okta, paypal, paypal-sandbox, pingfederate, planningcenter, salesforce-community, salesforce-sandbox, salesforce, samlp, sharepoint, shopify, shop, sms, soundcloud, thirtysevensignals, twitter, untappd, vkontakte, waad, weibo, windowslive, wordpress, yahoo, yandex ログイン時の認証で使用する接続の用途を設定します。
Show child attributes
Show child attributes
接続済みアカウントおよび Token Vault で使用する接続の用途を設定します。
Show child attributes
Show child attributes
新しい Universal Login エクスペリエンスで使用される接続名
128このプロパティの使用は推奨されません。クライアントのセットに対して接続を有効にするには、PATCH /v2/connections/{id}/clients エンドポイントを使用してください。
接続を有効にする対象のクライアントの id です。
true の場合、サードパーティアプリケーションで使用できるようにドメインレベルの接続に昇格します。false の場合、接続は昇格されないため、接続が有効になっているファーストパーティアプリケーションのみが使用できます。(デフォルトは false です。)
文字列値(最大 255 文字)を持つオブジェクト形式の、接続に関連付けられたメタデータ。メタデータのプロパティは最大 10 個まで指定できます。
Show child attributes
Show child attributes
接続のオプション(接続戦略によって異なります)
Show child attributes
Show child attributes
この接続が使用されるレルム(例: メールドメイン)を定義します。配列が空、またはプロパティが指定されていない場合は、接続名がレルムとして追加されます。
この接続が属するレルム
ログインページにこの接続のボタンを表示できるようにします(新しいエクスペリエンスのみ)。false の場合、HRD でのみ使用できます。(デフォルトは false です。)
レスポンス
接続を作成しました。
ログイン時の認証で使用する接続の用途を設定します。
Show child attributes
Show child attributes
接続済みアカウントおよび Token Vault で使用する接続の用途を設定します。
Show child attributes
Show child attributes
ログイン画面で使用される接続名
非推奨のプロパティです。接続が有効になっているクライアントの id を取得するには、GET /connections/:id/clients エンドポイントを使用してください
クライアントID
接続の識別子
接続がドメインレベルの場合は true
文字列値(最大 255 文字)を持つオブジェクト形式の、接続に関連付けられたメタデータ。メタデータのプロパティは最大 10 個まで指定できます。
Show child attributes
Show child attributes
接続名
レスポンスで options を返すには、read:connections_options スコープが含まれている必要があります
この接続が使用されるレルム(例: メールドメイン)を定義します。配列が空、またはこのプロパティが指定されていない場合は、接続名がレルムとして追加されます。
この接続が属するレルム
ログインページにこの接続のボタンを表示する機能を有効にします(新しいエクスペリエンスのみ)。false の場合は、HRD でのみ使用できます。
IDプロバイダーに関連する接続のタイプ