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"
}Créer une politique de protection CAPTCHA contre les attaques
Créer une nouvelle politique de protection CAPTCHA contre les attaques pour le locataire. Le nombre maximal de politiques par locataire dépend de son abonnement.
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"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
La politique de protection CAPTCHA contre les attaques à créer.
Corps de la requête pour créer une politique de protection CAPTCHA contre les attaques.
Nom de la politique lisible par une personne.
1 - 255Ordre de résolution des conflits. Plus le nombre est petit, plus la priorité est élevée. Ce nombre doit être unique au sein du locataire.
x >= 1Critères de correspondance du trafic pour la politique. Il faut préciser exactement un des deux champs : auth0_managed ou geo_country_codes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Configuration CAPTCHA de remplacement pour cette politique.
Show child attributes
Show child attributes
Description de la politique de protection contre les attaques.
Réponse
La politique de protection CAPTCHA contre les attaques a été créée avec succès.
Une politique de remplacement pour la protection CAPTCHA contre les attaques.
Identifiant de la politique généré par le système.
Nom de la politique lisible par une personne.
1 - 255Ordre de résolution des conflits. Un nombre plus faible indique une priorité plus élevée.
x >= 1Critères de correspondance du trafic pour la politique. Il faut préciser exactement un des deux champs : auth0_managed ou geo_country_codes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Configuration CAPTCHA de remplacement enregistrée pour cette politique.
Show child attributes
Show child attributes
Horodatage au format ISO 8601 de la création de la politique.
Horodatage au format ISO 8601 de la dernière mise à jour de la politique.
Description de l’objectif de la politique.