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>",
"options": {
"validation": {
"username": {
"min": 2,
"max": 123
}
},
"non_persistent_attrs": [
"<string>"
],
"precedence": [],
"attributes": {
"email": {
"identifier": {
"active": true
},
"unique": true,
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"phone_number": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"username": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {},
"validation": {
"min_length": 64.5,
"max_length": 64.5,
"allowed_types": {
"email": true,
"phone_number": true
}
}
}
},
"enable_script_context": true,
"enabledDatabaseCustomization": true,
"import_mode": true,
"configuration": {},
"customScripts": {
"login": "<string>",
"get_user": "<string>",
"delete": "<string>",
"change_password": "<string>",
"verify": "<string>",
"create": "<string>",
"change_username": "<string>",
"change_email": "<string>",
"change_phone_number": "<string>"
},
"authentication_methods": {
"password": {
"enabled": true
},
"passkey": {
"enabled": true
},
"email_otp": {
"enabled": true
},
"phone_otp": {
"enabled": true
}
},
"passkey_options": {
"progressive_enrollment_enabled": true,
"local_enrollment_enabled": true
},
"password_complexity_options": {
"min_length": 64
},
"password_history": {
"enable": true,
"size": 12
},
"password_no_personal_info": {
"enable": true
},
"password_dictionary": {
"enable": true,
"dictionary": [
"<string>"
]
},
"api_enable_users": true,
"api_enable_groups": true,
"basic_profile": true,
"ext_admin": true,
"ext_is_suspended": true,
"ext_agreed_terms": true,
"ext_groups": true,
"ext_assigned_plans": true,
"ext_profile": true,
"disable_self_service_change_password": true,
"upstream_params": {},
"set_user_root_attributes": "on_each_login",
"gateway_authentication": {
"method": "<string>",
"audience": "<string>",
"secret": "<string>",
"subject": "<string>",
"secret_base64_encoded": true
},
"federated_connections_access_tokens": {
"active": true
},
"password_options": {
"complexity": {
"min_length": 36,
"character_types": []
},
"dictionary": {
"active": true,
"custom": [
"<string>"
]
},
"history": {
"active": true,
"size": 12
},
"profile_data": {
"active": true,
"blocked_fields": [
"<string>"
]
}
},
"id_token_signed_response_algs": [],
"id_token_session_expiry_supported": true
},
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"show_as_button": true,
"realms": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://{tenantDomain}/api/v2/connections"
payload = {
"name": "<string>",
"display_name": "<string>",
"options": {
"validation": { "username": {
"min": 2,
"max": 123
} },
"non_persistent_attrs": ["<string>"],
"precedence": [],
"attributes": {
"email": {
"identifier": { "active": True },
"unique": True,
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"phone_number": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"username": {
"identifier": { "active": True },
"profile_required": True,
"signup": {},
"validation": {
"min_length": 64.5,
"max_length": 64.5,
"allowed_types": {
"email": True,
"phone_number": True
}
}
}
},
"enable_script_context": True,
"enabledDatabaseCustomization": True,
"import_mode": True,
"configuration": {},
"customScripts": {
"login": "<string>",
"get_user": "<string>",
"delete": "<string>",
"change_password": "<string>",
"verify": "<string>",
"create": "<string>",
"change_username": "<string>",
"change_email": "<string>",
"change_phone_number": "<string>"
},
"authentication_methods": {
"password": { "enabled": True },
"passkey": { "enabled": True },
"email_otp": { "enabled": True },
"phone_otp": { "enabled": True }
},
"passkey_options": {
"progressive_enrollment_enabled": True,
"local_enrollment_enabled": True
},
"password_complexity_options": { "min_length": 64 },
"password_history": {
"enable": True,
"size": 12
},
"password_no_personal_info": { "enable": True },
"password_dictionary": {
"enable": True,
"dictionary": ["<string>"]
},
"api_enable_users": True,
"api_enable_groups": True,
"basic_profile": True,
"ext_admin": True,
"ext_is_suspended": True,
"ext_agreed_terms": True,
"ext_groups": True,
"ext_assigned_plans": True,
"ext_profile": True,
"disable_self_service_change_password": True,
"upstream_params": {},
"set_user_root_attributes": "on_each_login",
"gateway_authentication": {
"method": "<string>",
"audience": "<string>",
"secret": "<string>",
"subject": "<string>",
"secret_base64_encoded": True
},
"federated_connections_access_tokens": { "active": True },
"password_options": {
"complexity": {
"min_length": 36,
"character_types": []
},
"dictionary": {
"active": True,
"custom": ["<string>"]
},
"history": {
"active": True,
"size": 12
},
"profile_data": {
"active": True,
"blocked_fields": ["<string>"]
}
},
"id_token_signed_response_algs": [],
"id_token_session_expiry_supported": True
},
"enabled_clients": ["<string>"],
"is_domain_connection": True,
"show_as_button": True,
"realms": ["<string>"],
"metadata": {}
}
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>',
'options' => [
'validation' => [
'username' => [
'min' => 2,
'max' => 123
]
],
'non_persistent_attrs' => [
'<string>'
],
'precedence' => [
],
'attributes' => [
'email' => [
'identifier' => [
'active' => true
],
'unique' => true,
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'phone_number' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'username' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
],
'validation' => [
'min_length' => 64.5,
'max_length' => 64.5,
'allowed_types' => [
'email' => true,
'phone_number' => true
]
]
]
],
'enable_script_context' => true,
'enabledDatabaseCustomization' => true,
'import_mode' => true,
'configuration' => [
],
'customScripts' => [
'login' => '<string>',
'get_user' => '<string>',
'delete' => '<string>',
'change_password' => '<string>',
'verify' => '<string>',
'create' => '<string>',
'change_username' => '<string>',
'change_email' => '<string>',
'change_phone_number' => '<string>'
],
'authentication_methods' => [
'password' => [
'enabled' => true
],
'passkey' => [
'enabled' => true
],
'email_otp' => [
'enabled' => true
],
'phone_otp' => [
'enabled' => true
]
],
'passkey_options' => [
'progressive_enrollment_enabled' => true,
'local_enrollment_enabled' => true
],
'password_complexity_options' => [
'min_length' => 64
],
'password_history' => [
'enable' => true,
'size' => 12
],
'password_no_personal_info' => [
'enable' => true
],
'password_dictionary' => [
'enable' => true,
'dictionary' => [
'<string>'
]
],
'api_enable_users' => true,
'api_enable_groups' => true,
'basic_profile' => true,
'ext_admin' => true,
'ext_is_suspended' => true,
'ext_agreed_terms' => true,
'ext_groups' => true,
'ext_assigned_plans' => true,
'ext_profile' => true,
'disable_self_service_change_password' => true,
'upstream_params' => [
],
'set_user_root_attributes' => 'on_each_login',
'gateway_authentication' => [
'method' => '<string>',
'audience' => '<string>',
'secret' => '<string>',
'subject' => '<string>',
'secret_base64_encoded' => true
],
'federated_connections_access_tokens' => [
'active' => true
],
'password_options' => [
'complexity' => [
'min_length' => 36,
'character_types' => [
]
],
'dictionary' => [
'active' => true,
'custom' => [
'<string>'
]
],
'history' => [
'active' => true,
'size' => 12
],
'profile_data' => [
'active' => true,
'blocked_fields' => [
'<string>'
]
]
],
'id_token_signed_response_algs' => [
],
'id_token_session_expiry_supported' => true
],
'enabled_clients' => [
'<string>'
],
'is_domain_connection' => true,
'show_as_button' => true,
'realms' => [
'<string>'
],
'metadata' => [
]
]),
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 \"options\": {\n \"validation\": {\n \"username\": {\n \"min\": 2,\n \"max\": 123\n }\n },\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"precedence\": [],\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"unique\": true,\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\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 \"min_length\": 64.5,\n \"max_length\": 64.5,\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n }\n }\n }\n },\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"import_mode\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"login\": \"<string>\",\n \"get_user\": \"<string>\",\n \"delete\": \"<string>\",\n \"change_password\": \"<string>\",\n \"verify\": \"<string>\",\n \"create\": \"<string>\",\n \"change_username\": \"<string>\",\n \"change_email\": \"<string>\",\n \"change_phone_number\": \"<string>\"\n },\n \"authentication_methods\": {\n \"password\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"email_otp\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"passkey_options\": {\n \"progressive_enrollment_enabled\": true,\n \"local_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"api_enable_users\": true,\n \"api_enable_groups\": true,\n \"basic_profile\": true,\n \"ext_admin\": true,\n \"ext_is_suspended\": true,\n \"ext_agreed_terms\": true,\n \"ext_groups\": true,\n \"ext_assigned_plans\": true,\n \"ext_profile\": true,\n \"disable_self_service_change_password\": true,\n \"upstream_params\": {},\n \"set_user_root_attributes\": \"on_each_login\",\n \"gateway_authentication\": {\n \"method\": \"<string>\",\n \"audience\": \"<string>\",\n \"secret\": \"<string>\",\n \"subject\": \"<string>\",\n \"secret_base64_encoded\": true\n },\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"min_length\": 36,\n \"character_types\": []\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 \"id_token_signed_response_algs\": [],\n \"id_token_session_expiry_supported\": true\n },\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"show_as_button\": true,\n \"realms\": [\n \"<string>\"\n ],\n \"metadata\": {}\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 \"options\": {\n \"validation\": {\n \"username\": {\n \"min\": 2,\n \"max\": 123\n }\n },\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"precedence\": [],\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"unique\": true,\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\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 \"min_length\": 64.5,\n \"max_length\": 64.5,\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n }\n }\n }\n },\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"import_mode\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"login\": \"<string>\",\n \"get_user\": \"<string>\",\n \"delete\": \"<string>\",\n \"change_password\": \"<string>\",\n \"verify\": \"<string>\",\n \"create\": \"<string>\",\n \"change_username\": \"<string>\",\n \"change_email\": \"<string>\",\n \"change_phone_number\": \"<string>\"\n },\n \"authentication_methods\": {\n \"password\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"email_otp\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"passkey_options\": {\n \"progressive_enrollment_enabled\": true,\n \"local_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"api_enable_users\": true,\n \"api_enable_groups\": true,\n \"basic_profile\": true,\n \"ext_admin\": true,\n \"ext_is_suspended\": true,\n \"ext_agreed_terms\": true,\n \"ext_groups\": true,\n \"ext_assigned_plans\": true,\n \"ext_profile\": true,\n \"disable_self_service_change_password\": true,\n \"upstream_params\": {},\n \"set_user_root_attributes\": \"on_each_login\",\n \"gateway_authentication\": {\n \"method\": \"<string>\",\n \"audience\": \"<string>\",\n \"secret\": \"<string>\",\n \"subject\": \"<string>\",\n \"secret_base64_encoded\": true\n },\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"min_length\": 36,\n \"character_types\": []\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 \"id_token_signed_response_algs\": [],\n \"id_token_session_expiry_supported\": true\n },\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"show_as_button\": true,\n \"realms\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"name": "My connection",
"display_name": "<string>",
"options": {},
"id": "con_0000000000000001",
"strategy": "auth0",
"realms": [
"<string>"
],
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"show_as_button": true,
"metadata": {},
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
}
}Create a connection
Creates a new connection according to the JSON object received in body.
Note: If a connection with the same name was recently deleted and had a large number of associated users, the deletion may still be processing. Creating a new connection with that name before the deletion completes may fail or produce unexpected results.
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>",
"options": {
"validation": {
"username": {
"min": 2,
"max": 123
}
},
"non_persistent_attrs": [
"<string>"
],
"precedence": [],
"attributes": {
"email": {
"identifier": {
"active": true
},
"unique": true,
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"phone_number": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {
"verification": {
"active": true
}
}
},
"username": {
"identifier": {
"active": true
},
"profile_required": true,
"signup": {},
"validation": {
"min_length": 64.5,
"max_length": 64.5,
"allowed_types": {
"email": true,
"phone_number": true
}
}
}
},
"enable_script_context": true,
"enabledDatabaseCustomization": true,
"import_mode": true,
"configuration": {},
"customScripts": {
"login": "<string>",
"get_user": "<string>",
"delete": "<string>",
"change_password": "<string>",
"verify": "<string>",
"create": "<string>",
"change_username": "<string>",
"change_email": "<string>",
"change_phone_number": "<string>"
},
"authentication_methods": {
"password": {
"enabled": true
},
"passkey": {
"enabled": true
},
"email_otp": {
"enabled": true
},
"phone_otp": {
"enabled": true
}
},
"passkey_options": {
"progressive_enrollment_enabled": true,
"local_enrollment_enabled": true
},
"password_complexity_options": {
"min_length": 64
},
"password_history": {
"enable": true,
"size": 12
},
"password_no_personal_info": {
"enable": true
},
"password_dictionary": {
"enable": true,
"dictionary": [
"<string>"
]
},
"api_enable_users": true,
"api_enable_groups": true,
"basic_profile": true,
"ext_admin": true,
"ext_is_suspended": true,
"ext_agreed_terms": true,
"ext_groups": true,
"ext_assigned_plans": true,
"ext_profile": true,
"disable_self_service_change_password": true,
"upstream_params": {},
"set_user_root_attributes": "on_each_login",
"gateway_authentication": {
"method": "<string>",
"audience": "<string>",
"secret": "<string>",
"subject": "<string>",
"secret_base64_encoded": true
},
"federated_connections_access_tokens": {
"active": true
},
"password_options": {
"complexity": {
"min_length": 36,
"character_types": []
},
"dictionary": {
"active": true,
"custom": [
"<string>"
]
},
"history": {
"active": true,
"size": 12
},
"profile_data": {
"active": true,
"blocked_fields": [
"<string>"
]
}
},
"id_token_signed_response_algs": [],
"id_token_session_expiry_supported": true
},
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"show_as_button": true,
"realms": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://{tenantDomain}/api/v2/connections"
payload = {
"name": "<string>",
"display_name": "<string>",
"options": {
"validation": { "username": {
"min": 2,
"max": 123
} },
"non_persistent_attrs": ["<string>"],
"precedence": [],
"attributes": {
"email": {
"identifier": { "active": True },
"unique": True,
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"phone_number": {
"identifier": { "active": True },
"profile_required": True,
"signup": { "verification": { "active": True } }
},
"username": {
"identifier": { "active": True },
"profile_required": True,
"signup": {},
"validation": {
"min_length": 64.5,
"max_length": 64.5,
"allowed_types": {
"email": True,
"phone_number": True
}
}
}
},
"enable_script_context": True,
"enabledDatabaseCustomization": True,
"import_mode": True,
"configuration": {},
"customScripts": {
"login": "<string>",
"get_user": "<string>",
"delete": "<string>",
"change_password": "<string>",
"verify": "<string>",
"create": "<string>",
"change_username": "<string>",
"change_email": "<string>",
"change_phone_number": "<string>"
},
"authentication_methods": {
"password": { "enabled": True },
"passkey": { "enabled": True },
"email_otp": { "enabled": True },
"phone_otp": { "enabled": True }
},
"passkey_options": {
"progressive_enrollment_enabled": True,
"local_enrollment_enabled": True
},
"password_complexity_options": { "min_length": 64 },
"password_history": {
"enable": True,
"size": 12
},
"password_no_personal_info": { "enable": True },
"password_dictionary": {
"enable": True,
"dictionary": ["<string>"]
},
"api_enable_users": True,
"api_enable_groups": True,
"basic_profile": True,
"ext_admin": True,
"ext_is_suspended": True,
"ext_agreed_terms": True,
"ext_groups": True,
"ext_assigned_plans": True,
"ext_profile": True,
"disable_self_service_change_password": True,
"upstream_params": {},
"set_user_root_attributes": "on_each_login",
"gateway_authentication": {
"method": "<string>",
"audience": "<string>",
"secret": "<string>",
"subject": "<string>",
"secret_base64_encoded": True
},
"federated_connections_access_tokens": { "active": True },
"password_options": {
"complexity": {
"min_length": 36,
"character_types": []
},
"dictionary": {
"active": True,
"custom": ["<string>"]
},
"history": {
"active": True,
"size": 12
},
"profile_data": {
"active": True,
"blocked_fields": ["<string>"]
}
},
"id_token_signed_response_algs": [],
"id_token_session_expiry_supported": True
},
"enabled_clients": ["<string>"],
"is_domain_connection": True,
"show_as_button": True,
"realms": ["<string>"],
"metadata": {}
}
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>',
'options' => [
'validation' => [
'username' => [
'min' => 2,
'max' => 123
]
],
'non_persistent_attrs' => [
'<string>'
],
'precedence' => [
],
'attributes' => [
'email' => [
'identifier' => [
'active' => true
],
'unique' => true,
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'phone_number' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
'verification' => [
'active' => true
]
]
],
'username' => [
'identifier' => [
'active' => true
],
'profile_required' => true,
'signup' => [
],
'validation' => [
'min_length' => 64.5,
'max_length' => 64.5,
'allowed_types' => [
'email' => true,
'phone_number' => true
]
]
]
],
'enable_script_context' => true,
'enabledDatabaseCustomization' => true,
'import_mode' => true,
'configuration' => [
],
'customScripts' => [
'login' => '<string>',
'get_user' => '<string>',
'delete' => '<string>',
'change_password' => '<string>',
'verify' => '<string>',
'create' => '<string>',
'change_username' => '<string>',
'change_email' => '<string>',
'change_phone_number' => '<string>'
],
'authentication_methods' => [
'password' => [
'enabled' => true
],
'passkey' => [
'enabled' => true
],
'email_otp' => [
'enabled' => true
],
'phone_otp' => [
'enabled' => true
]
],
'passkey_options' => [
'progressive_enrollment_enabled' => true,
'local_enrollment_enabled' => true
],
'password_complexity_options' => [
'min_length' => 64
],
'password_history' => [
'enable' => true,
'size' => 12
],
'password_no_personal_info' => [
'enable' => true
],
'password_dictionary' => [
'enable' => true,
'dictionary' => [
'<string>'
]
],
'api_enable_users' => true,
'api_enable_groups' => true,
'basic_profile' => true,
'ext_admin' => true,
'ext_is_suspended' => true,
'ext_agreed_terms' => true,
'ext_groups' => true,
'ext_assigned_plans' => true,
'ext_profile' => true,
'disable_self_service_change_password' => true,
'upstream_params' => [
],
'set_user_root_attributes' => 'on_each_login',
'gateway_authentication' => [
'method' => '<string>',
'audience' => '<string>',
'secret' => '<string>',
'subject' => '<string>',
'secret_base64_encoded' => true
],
'federated_connections_access_tokens' => [
'active' => true
],
'password_options' => [
'complexity' => [
'min_length' => 36,
'character_types' => [
]
],
'dictionary' => [
'active' => true,
'custom' => [
'<string>'
]
],
'history' => [
'active' => true,
'size' => 12
],
'profile_data' => [
'active' => true,
'blocked_fields' => [
'<string>'
]
]
],
'id_token_signed_response_algs' => [
],
'id_token_session_expiry_supported' => true
],
'enabled_clients' => [
'<string>'
],
'is_domain_connection' => true,
'show_as_button' => true,
'realms' => [
'<string>'
],
'metadata' => [
]
]),
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 \"options\": {\n \"validation\": {\n \"username\": {\n \"min\": 2,\n \"max\": 123\n }\n },\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"precedence\": [],\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"unique\": true,\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\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 \"min_length\": 64.5,\n \"max_length\": 64.5,\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n }\n }\n }\n },\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"import_mode\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"login\": \"<string>\",\n \"get_user\": \"<string>\",\n \"delete\": \"<string>\",\n \"change_password\": \"<string>\",\n \"verify\": \"<string>\",\n \"create\": \"<string>\",\n \"change_username\": \"<string>\",\n \"change_email\": \"<string>\",\n \"change_phone_number\": \"<string>\"\n },\n \"authentication_methods\": {\n \"password\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"email_otp\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"passkey_options\": {\n \"progressive_enrollment_enabled\": true,\n \"local_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"api_enable_users\": true,\n \"api_enable_groups\": true,\n \"basic_profile\": true,\n \"ext_admin\": true,\n \"ext_is_suspended\": true,\n \"ext_agreed_terms\": true,\n \"ext_groups\": true,\n \"ext_assigned_plans\": true,\n \"ext_profile\": true,\n \"disable_self_service_change_password\": true,\n \"upstream_params\": {},\n \"set_user_root_attributes\": \"on_each_login\",\n \"gateway_authentication\": {\n \"method\": \"<string>\",\n \"audience\": \"<string>\",\n \"secret\": \"<string>\",\n \"subject\": \"<string>\",\n \"secret_base64_encoded\": true\n },\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"min_length\": 36,\n \"character_types\": []\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 \"id_token_signed_response_algs\": [],\n \"id_token_session_expiry_supported\": true\n },\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"show_as_button\": true,\n \"realms\": [\n \"<string>\"\n ],\n \"metadata\": {}\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 \"options\": {\n \"validation\": {\n \"username\": {\n \"min\": 2,\n \"max\": 123\n }\n },\n \"non_persistent_attrs\": [\n \"<string>\"\n ],\n \"precedence\": [],\n \"attributes\": {\n \"email\": {\n \"identifier\": {\n \"active\": true\n },\n \"unique\": true,\n \"profile_required\": true,\n \"signup\": {\n \"verification\": {\n \"active\": true\n }\n }\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 \"min_length\": 64.5,\n \"max_length\": 64.5,\n \"allowed_types\": {\n \"email\": true,\n \"phone_number\": true\n }\n }\n }\n },\n \"enable_script_context\": true,\n \"enabledDatabaseCustomization\": true,\n \"import_mode\": true,\n \"configuration\": {},\n \"customScripts\": {\n \"login\": \"<string>\",\n \"get_user\": \"<string>\",\n \"delete\": \"<string>\",\n \"change_password\": \"<string>\",\n \"verify\": \"<string>\",\n \"create\": \"<string>\",\n \"change_username\": \"<string>\",\n \"change_email\": \"<string>\",\n \"change_phone_number\": \"<string>\"\n },\n \"authentication_methods\": {\n \"password\": {\n \"enabled\": true\n },\n \"passkey\": {\n \"enabled\": true\n },\n \"email_otp\": {\n \"enabled\": true\n },\n \"phone_otp\": {\n \"enabled\": true\n }\n },\n \"passkey_options\": {\n \"progressive_enrollment_enabled\": true,\n \"local_enrollment_enabled\": true\n },\n \"password_complexity_options\": {\n \"min_length\": 64\n },\n \"password_history\": {\n \"enable\": true,\n \"size\": 12\n },\n \"password_no_personal_info\": {\n \"enable\": true\n },\n \"password_dictionary\": {\n \"enable\": true,\n \"dictionary\": [\n \"<string>\"\n ]\n },\n \"api_enable_users\": true,\n \"api_enable_groups\": true,\n \"basic_profile\": true,\n \"ext_admin\": true,\n \"ext_is_suspended\": true,\n \"ext_agreed_terms\": true,\n \"ext_groups\": true,\n \"ext_assigned_plans\": true,\n \"ext_profile\": true,\n \"disable_self_service_change_password\": true,\n \"upstream_params\": {},\n \"set_user_root_attributes\": \"on_each_login\",\n \"gateway_authentication\": {\n \"method\": \"<string>\",\n \"audience\": \"<string>\",\n \"secret\": \"<string>\",\n \"subject\": \"<string>\",\n \"secret_base64_encoded\": true\n },\n \"federated_connections_access_tokens\": {\n \"active\": true\n },\n \"password_options\": {\n \"complexity\": {\n \"min_length\": 36,\n \"character_types\": []\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 \"id_token_signed_response_algs\": [],\n \"id_token_session_expiry_supported\": true\n },\n \"enabled_clients\": [\n \"<string>\"\n ],\n \"is_domain_connection\": true,\n \"show_as_button\": true,\n \"realms\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"name": "My connection",
"display_name": "<string>",
"options": {},
"id": "con_0000000000000001",
"strategy": "auth0",
"realms": [
"<string>"
],
"enabled_clients": [
"<string>"
],
"is_domain_connection": true,
"show_as_button": true,
"metadata": {},
"authentication": {
"active": true
},
"connected_accounts": {
"active": true,
"cross_app_access": true
}
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128
128^[a-zA-Z0-9](-[a-zA-Z0-9]|[a-zA-Z0-9])*$The identity provider identifier for the connection
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 Connection name used in the new universal login experience
128The connection's options (depend on the connection strategy)
Show child attributes
Show child attributes
Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.
The id of the client for which the connection is to be enabled.
true promotes to a domain-level connection so that third-party applications can use it. false does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to false.)
Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. (Defaults to false.)
Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
The realm where this connection belongs
Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
Show child attributes
Show child attributes
Configure the purpose of a connection to be used for authentication during login.
Show child attributes
Show child attributes
Configure the purpose of a connection to be used for connected accounts and Token Vault.
Show child attributes
Show child attributes
レスポンス
The connection was created.
The name of the connection
Connection name used in login screen
In order to return options in the response, the read:connections_options scope must be present
The connection's identifier
The type of the connection, related to the identity provider
Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
The realm where this connection belongs
DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled
The client id
True if the connection is domain level
Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
Metadata associated with the connection in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed.
Show child attributes
Show child attributes
Configure the purpose of a connection to be used for authentication during login.
Show child attributes
Show child attributes
Configure the purpose of a connection to be used for connected accounts and Token Vault.
Show child attributes
Show child attributes
このページは役に立ちましたか?