curl --request POST \
--url https://{tenantDomain}/api/v2/attack-protection/captcha/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/attack-protection/captcha/policies"
payload = {
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": ["<string>"],
"geo_country_codes": ["<string>"]
},
"action": {
"simple_captcha": {},
"auth_challenge": { "fail_open": True },
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": True
}
},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
priority: 2,
match: {auth0_managed: ['<string>'], geo_country_codes: ['<string>']},
action: {
simple_captcha: {},
auth_challenge: {fail_open: true},
recaptcha_v2: {site_key: '<string>', secret: '<string>'},
recaptcha_enterprise: {site_key: '<string>', project_id: '<string>', api_key: '<string>'},
hcaptcha: {site_key: '<string>', secret: '<string>'},
friendly_captcha: {site_key: '<string>', secret: '<string>'},
arkose: {
site_key: '<string>',
secret: '<string>',
client_subdomain: '<string>',
verify_subdomain: '<string>',
fail_open: true
}
},
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/attack-protection/captcha/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/attack-protection/captcha/policies",
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>',
'priority' => 2,
'match' => [
'auth0_managed' => [
'<string>'
],
'geo_country_codes' => [
'<string>'
]
],
'action' => [
'simple_captcha' => [
],
'auth_challenge' => [
'fail_open' => true
],
'recaptcha_v2' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'recaptcha_enterprise' => [
'site_key' => '<string>',
'project_id' => '<string>',
'api_key' => '<string>'
],
'hcaptcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'friendly_captcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'arkose' => [
'site_key' => '<string>',
'secret' => '<string>',
'client_subdomain' => '<string>',
'verify_subdomain' => '<string>',
'fail_open' => true
]
],
'description' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/attack-protection/captcha/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/attack-protection/captcha/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/attack-protection/captcha/policies")
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 \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"active_provider_id": "simple_captcha",
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>"
},
"hcaptcha": {
"site_key": "<string>"
},
"friendly_captcha": {
"site_key": "<string>"
},
"arkose": {
"site_key": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 409,
"error": "Conflict"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}CAPTCHA攻撃防御ポリシーを作成
テナントの新しいCAPTCHA攻撃防御ポリシーを作成します。テナントごとのポリシー数の上限は、テナントのサブスクリプションによって決まります。
curl --request POST \
--url https://{tenantDomain}/api/v2/attack-protection/captcha/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/attack-protection/captcha/policies"
payload = {
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": ["<string>"],
"geo_country_codes": ["<string>"]
},
"action": {
"simple_captcha": {},
"auth_challenge": { "fail_open": True },
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": True
}
},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
priority: 2,
match: {auth0_managed: ['<string>'], geo_country_codes: ['<string>']},
action: {
simple_captcha: {},
auth_challenge: {fail_open: true},
recaptcha_v2: {site_key: '<string>', secret: '<string>'},
recaptcha_enterprise: {site_key: '<string>', project_id: '<string>', api_key: '<string>'},
hcaptcha: {site_key: '<string>', secret: '<string>'},
friendly_captcha: {site_key: '<string>', secret: '<string>'},
arkose: {
site_key: '<string>',
secret: '<string>',
client_subdomain: '<string>',
verify_subdomain: '<string>',
fail_open: true
}
},
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/attack-protection/captcha/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/attack-protection/captcha/policies",
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>',
'priority' => 2,
'match' => [
'auth0_managed' => [
'<string>'
],
'geo_country_codes' => [
'<string>'
]
],
'action' => [
'simple_captcha' => [
],
'auth_challenge' => [
'fail_open' => true
],
'recaptcha_v2' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'recaptcha_enterprise' => [
'site_key' => '<string>',
'project_id' => '<string>',
'api_key' => '<string>'
],
'hcaptcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'friendly_captcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'arkose' => [
'site_key' => '<string>',
'secret' => '<string>',
'client_subdomain' => '<string>',
'verify_subdomain' => '<string>',
'fail_open' => true
]
],
'description' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/attack-protection/captcha/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/attack-protection/captcha/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/attack-protection/captcha/policies")
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 \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n },\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"active_provider_id": "simple_captcha",
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>"
},
"hcaptcha": {
"site_key": "<string>"
},
"friendly_captcha": {
"site_key": "<string>"
},
"arkose": {
"site_key": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 409,
"error": "Conflict"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
作成するCAPTCHA攻撃防御ポリシー。
CAPTCHA攻撃防御ポリシーを作成するためのリクエスト本文。
人が見てわかりやすいポリシー名。
1 - 255競合を解決する際の優先順位。数値が小さいほど優先されます。テナント内で一意である必要があります。
x >= 1ポリシーの適用対象となるトラフィックの条件。auth0_managedまたはgeo_country_codesのいずれか一方のみを指定する必要があります。
- Option 1
- Option 2
Show child attributes
Show child attributes
このポリシーで使用するCAPTCHAの上書き設定。
Show child attributes
Show child attributes
攻撃防御ポリシーの説明。
レスポンス
CAPTCHA攻撃防御ポリシーを正常に作成しました。
CAPTCHAの攻撃防御ポリシーの上書き設定。
システムが生成したポリシーの識別子。
人が理解しやすいポリシー名。
1 - 255競合時の優先順位。数値が小さいほど優先されます。
x >= 1ポリシーの適用対象となるトラフィックの条件。auth0_managedまたはgeo_country_codesのいずれか一方のみを指定する必要があります。
- Option 1
- Option 2
Show child attributes
Show child attributes
このポリシー用に保存されたCAPTCHAの上書き設定。
Show child attributes
Show child attributes
ポリシーの作成日時を示すISO 8601形式のタイムスタンプ。
ポリシーの最終更新日時を示すISO 8601形式のタイムスタンプ。
ポリシーの目的の説明。