{
	"info": {
		"_postman_id": "e7947f8b-b260-4a5d-917b-47db68a3c6ef",
		"name": "ForgeRock CAPTCHA Collection",
		"description": "This collection contains the queries to demonstrate trees with the AM CAPTCHA node with ReCaptcha V2, V3 and hCAPTCHA.\n\nBefore you get started, you will need to setup a ReCaptcha V2 and V3 site and a hCaptcha site and copy their site and secret keys, then edit the CAPTCHA collection to set the variables provided to match your setup under the Variables tab.\n\nOnce the trees have been created visit the following URLs with the brower of your choice to demonstrate the login flow for each:\n * {{URL_base}}/XUI/?realm={{sub_realm}}&service=recaptchav3\n * {{URL_base}}/XUI/?realm={{sub_realm}}&service=recaptchav2\n * {{URL_base}}/XUI/?realm={{sub_realm}}&service=hcaptcha \n\nYou can use {{demo_username}} and {{demo_password}} for the demo user set up in Prerequisites Step 3 to log in.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Prerequisites",
			"item": [
				{
					"name": "Step 1: Login as Admin",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"pm.collectionVariables.set(\"adminSSOToken\", jsonData.tokenId);",
									"",
									""
								],
								"type": "text/javascript"
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"protocolProfileBehavior": {
						"disableCookies": false
					},
					"request": {
						"method": "POST",
						"header": [
							{
								"description": "Username for a ForgeRock administrator.",
								"key": "X-OpenAM-Username",
								"value": "{{admin_username}}"
							},
							{
								"description": "Password for a ForgeRock administrator.",
								"key": "X-OpenAM-Password",
								"value": "{{admin_password}}"
							},
							{
								"description": "The media type of the resource.",
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"description": "This collection documents version 2.1 of the authentication resource.",
								"key": "Accept-API-Version",
								"value": "resource=2.1"
							}
						],
						"url": {
							"raw": "{{URL_base}}/json/realms/root/authenticate",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"root",
								"authenticate"
							]
						},
						"description": "To get started, log in to the authorization server using the credentials of the administator to receive an administrative SSO token."
					},
					"response": []
				},
				{
					"name": "Step 2: Create a SubRealm",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = JSON.parse(responseBody);",
									"",
									"// TESTS",
									"",
									"pm.test(\"Status code is 201.\", () => {",
									"  pm.expect(pm.response.code).to.eql(201);",
									"});",
									"",
									"pm.test(\"Response contains an ID\", function () {",
									"    pm.expect(jsonData).to.have.any.keys('_id');",
									"});",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "cookie",
								"value": "iplanetDirectoryPro={{adminSSOToken}}"
							},
							{
								"key": "Accept-API-Version",
								"value": "resource=1.0"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"{{sub_realm}}\",\n    \"active\": true,\n    \"parentPath\": \"/\",\n    \"aliases\": [ \"captcha.example.com\" ]\n}"
						},
						"url": {
							"raw": "{{URL_base}}/json/global-config/realms",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"global-config",
								"realms"
							]
						},
						"description": "Create a subrealm, under which everything created in this collection will be stored."
					},
					"response": []
				},
				{
					"name": "Step 3: Create a Demo User",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"// Tests",
									"pm.test(\"Status code is 201.\", () => {",
									"  pm.expect(pm.response.code).to.eql(201);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept-API-Version",
								"value": "protocol=2.1,resource=3.0"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Cookie",
								"value": "iplanetDirectoryPro={{adminSSOToken}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"username\": \"{{demo_username}}\",\n    \"userpassword\": \"{{demo_password}}\",\n    \"mail\": \"forgerockdemo@example.com\"\n}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/users/?_action=create",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"users",
								""
							],
							"query": [
								{
									"key": "_action",
									"value": "create"
								}
							]
						},
						"description": "A demonstration user that can be used to demo the CAPTCHA trees once they are created."
					},
					"response": []
				}
			]
		},
		{
			"name": "ReCaptchaV3 Tree",
			"item": [
				{
					"name": "Step 1: Create ReCaptcha V3 Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"apiUri\": \"https://www.google.com/recaptcha/api.js\",\n  \"captchaUri\": \"https://www.google.com/recaptcha/api/siteverify\",\n  \"scoreThreshold\": \"0.5\",\n  \"divClass\": \"g-recaptcha\",\n  \"reCaptchaV3\": true,\n  \"_id\": \"4e11c02b-cb8f-4923-85db-9981efd0a536\",\n  \"siteKey\": \"{{recaptcha_v3_sitekey}}\",\n  \"secretKey\": \"{{recaptcha_v3_secret_key}}\"\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/product-CaptchaNode/4e11c02b-cb8f-4923-85db-9981efd0a536",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"product-CaptchaNode",
								"4e11c02b-cb8f-4923-85db-9981efd0a536"
							]
						},
						"description": "Creates a new CAPTCHA node configured for ReCaptcha V3 using the value of {{recaptcha_v3_sitekey}} and {{recaptcha_v3_secret_key}} for the sitekey and secret key respectively."
					},
					"response": []
				},
				{
					"name": "Step 2: Create Username Collector Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"75f576a7-cdbd-4e65-a1dd-a5d17a843de7\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/UsernameCollectorNode/75f576a7-cdbd-4e65-a1dd-a5d17a843de7",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"UsernameCollectorNode",
								"75f576a7-cdbd-4e65-a1dd-a5d17a843de7"
							]
						},
						"description": "Creates a new username node."
					},
					"response": []
				},
				{
					"name": "Step 3: Create Password Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"c6ff26a6-bbb0-496a-95e7-5761e6c901fc\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/PasswordCollectorNode/c6ff26a6-bbb0-496a-95e7-5761e6c901fc",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"PasswordCollectorNode",
								"c6ff26a6-bbb0-496a-95e7-5761e6c901fc"
							]
						},
						"description": "Creates a new password node."
					},
					"response": []
				},
				{
					"name": "Step 4: Create Data Store Decision Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"e5ab4cea-b873-4513-8021-9ce038b2de19\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/DataStoreDecisionNode/e5ab4cea-b873-4513-8021-9ce038b2de19",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"DataStoreDecisionNode",
								"e5ab4cea-b873-4513-8021-9ce038b2de19"
							]
						},
						"description": "Creates a new datastore decision node."
					},
					"response": []
				},
				{
					"name": "Step 5: Create Page Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"pageHeader\": {},\n  \"pageDescription\": {},\n  \"nodes\": [\n    {\n      \"_id\": \"75f576a7-cdbd-4e65-a1dd-a5d17a843de7\",\n      \"displayName\": \"Username Collector\",\n      \"nodeType\": \"UsernameCollectorNode\",\n      \"x\": 293,\n      \"y\": 224\n    },\n    {\n      \"_id\": \"c6ff26a6-bbb0-496a-95e7-5761e6c901fc\",\n      \"displayName\": \"Password Collector\",\n      \"nodeType\": \"PasswordCollectorNode\",\n      \"x\": 167,\n      \"y\": 161\n    },\n    {\n      \"_id\": \"4e11c02b-cb8f-4923-85db-9981efd0a536\",\n      \"displayName\": \"ReCAPTCHA v3\",\n      \"nodeType\": \"product-CaptchaNode\",\n      \"x\": 372,\n      \"y\": 133\n    }\n  ],\n  \"_id\": \"2ee118c0-f552-494f-b9ee-6086cc338aa3\"\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/PageNode/2ee118c0-f552-494f-b9ee-6086cc338aa3",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"PageNode",
								"2ee118c0-f552-494f-b9ee-6086cc338aa3"
							]
						},
						"description": "Creates a new Page Node that contains the Username Collector Node, the Password Node, and the ReCaptcha V3 node created in steps 1, 2, and 3."
					},
					"response": []
				},
				{
					"name": "Step 6: Create ReCaptcha V3 Tree",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "accept-api-version",
								"type": "text",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "Accept",
								"type": "text",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"type": "text",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"_id\": \"recaptchav3\",\n  \"entryNodeId\": \"2ee118c0-f552-494f-b9ee-6086cc338aa3\",\n  \"staticNodes\": {\n    \"startNode\": { \"x\": 50, \"y\": 25 },\n    \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\": { \"x\": 741, \"y\": 44 },\n    \"e301438c-0bd0-429c-ab0c-66126501069a\": { \"x\": 737, \"y\": 242 }\n  },\n  \"uiConfig\": {},\n  \"nodes\": {\n    \"2ee118c0-f552-494f-b9ee-6086cc338aa3\": {\n      \"displayName\": \"Page Node\",\n      \"nodeType\": \"PageNode\",\n      \"x\": 117,\n      \"y\": 93,\n      \"connections\": {\n        \"true\": \"e5ab4cea-b873-4513-8021-9ce038b2de19\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    },\n    \"e5ab4cea-b873-4513-8021-9ce038b2de19\": {\n      \"displayName\": \"Data Store Decision\",\n      \"nodeType\": \"DataStoreDecisionNode\",\n      \"x\": 379,\n      \"y\": 100,\n      \"connections\": {\n        \"true\": \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    }\n  }\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/trees/recaptchav3",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"trees",
								"recaptchav3"
							]
						},
						"description": "Creates a new tree containing the Page Node created in step 5 and the Data Store Decision Node created in step 4. To login using this tree use the URL {{URL_base}}/XUI/?service=recaptchav3."
					},
					"response": []
				}
			]
		},
		{
			"name": "ReCaptchaV2 Tree",
			"item": [
				{
					"name": "Step 1: Create Username Collector Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"a6cfc601-d3e3-4af0-b1b5-e7979504388a\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/UsernameCollectorNode/a6cfc601-d3e3-4af0-b1b5-e7979504388a",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"UsernameCollectorNode",
								"a6cfc601-d3e3-4af0-b1b5-e7979504388a"
							]
						},
						"description": "Creates a new Username Collector Node."
					},
					"response": []
				},
				{
					"name": "Step 2: Create Password Collector Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"6130c250-c28d-4c95-9dfe-1dc2156a81ea\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/PasswordCollectorNode/6130c250-c28d-4c95-9dfe-1dc2156a81ea",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"PasswordCollectorNode",
								"6130c250-c28d-4c95-9dfe-1dc2156a81ea"
							]
						},
						"description": "Creates a new Password Collector Node."
					},
					"response": []
				},
				{
					"name": "Step 3: Create ReCaptcha V2 Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"reCaptchaV3\": false,\n  \"scoreThreshold\": \"0.0\",\n  \"apiUri\": \"https://www.google.com/recaptcha/api.js\",\n  \"captchaUri\": \"https://www.google.com/recaptcha/api/siteverify\",\n  \"divClass\": \"g-recaptcha\",\n  \"_id\": \"76ff1fcb-6d8c-4825-822e-3d0818ddd1db\",\n  \"siteKey\": \"{{recaptcha_v2_sitekey}}\",\n  \"secretKey\": \"{{recaptcha_v2_secret_key}}\"\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/product-CaptchaNode/76ff1fcb-6d8c-4825-822e-3d0818ddd1db",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"product-CaptchaNode",
								"76ff1fcb-6d8c-4825-822e-3d0818ddd1db"
							]
						},
						"description": "Creates a new CAPTCHA node configured for ReCaptcha V2 using the value of {{recaptcha_v2_sitekey}} and {{recaptcha_v2_secret_key}} for the sitekey and secret key respectively."
					},
					"response": []
				},
				{
					"name": "Step 4: Create Data Store Decision Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"2ac9ff68-e402-4fe4-971f-07958a20cdec\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/DataStoreDecisionNode/2ac9ff68-e402-4fe4-971f-07958a20cdec",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"DataStoreDecisionNode",
								"2ac9ff68-e402-4fe4-971f-07958a20cdec"
							]
						},
						"description": "Creates a new Data Store Decision Node."
					},
					"response": []
				},
				{
					"name": "Step 5: Create ReCaptcha V2 Tree",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"_id\": \"recaptchav2\",\n  \"entryNodeId\": \"a6cfc601-d3e3-4af0-b1b5-e7979504388a\",\n  \"staticNodes\": {\n    \"startNode\": { \"x\": 50, \"y\": 25 },\n    \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\": { \"x\": 963, \"y\": 97 },\n    \"e301438c-0bd0-429c-ab0c-66126501069a\": { \"x\": 973, \"y\": 180 }\n  },\n  \"uiConfig\": {},\n  \"nodes\": {\n    \"a6cfc601-d3e3-4af0-b1b5-e7979504388a\": {\n      \"displayName\": \"Username Collector\",\n      \"nodeType\": \"UsernameCollectorNode\",\n      \"x\": 146,\n      \"y\": 91,\n      \"connections\": { \"outcome\": \"6130c250-c28d-4c95-9dfe-1dc2156a81ea\" }\n    },\n    \"6130c250-c28d-4c95-9dfe-1dc2156a81ea\": {\n      \"displayName\": \"Password Collector\",\n      \"nodeType\": \"PasswordCollectorNode\",\n      \"x\": 342,\n      \"y\": 90,\n      \"connections\": { \"outcome\": \"76ff1fcb-6d8c-4825-822e-3d0818ddd1db\" }\n    },\n    \"76ff1fcb-6d8c-4825-822e-3d0818ddd1db\": {\n      \"displayName\": \"ReCAPTCHA V2\",\n      \"nodeType\": \"product-CaptchaNode\",\n      \"x\": 552,\n      \"y\": 88,\n      \"connections\": {\n        \"true\": \"2ac9ff68-e402-4fe4-971f-07958a20cdec\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    },\n    \"2ac9ff68-e402-4fe4-971f-07958a20cdec\": {\n      \"displayName\": \"Data Store Decision\",\n      \"nodeType\": \"DataStoreDecisionNode\",\n      \"x\": 715,\n      \"y\": 69,\n      \"connections\": {\n        \"true\": \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    }\n  }\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/trees/recaptchav2",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"trees",
								"recaptchav2"
							]
						},
						"description": "Creates a new tree containing the nodes created in steps 1 to 4. To login using this tree use the URL {{URL_base}}/XUI/?service=recaptchav2."
					},
					"response": []
				}
			]
		},
		{
			"name": "hCaptcha Tree",
			"item": [
				{
					"name": "Step 1: Create Data Store Decision Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"5a3a92d3-912c-44e0-8ef4-33d3b5757eab\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/DataStoreDecisionNode/5a3a92d3-912c-44e0-8ef4-33d3b5757eab",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"DataStoreDecisionNode",
								"5a3a92d3-912c-44e0-8ef4-33d3b5757eab"
							]
						},
						"description": "Creates a new Data Store Decision Node."
					},
					"response": []
				},
				{
					"name": "Step 2: Create Password Collector Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"4457d0a4-748e-4844-8eab-d8ad09748ee0\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/PasswordCollectorNode/4457d0a4-748e-4844-8eab-d8ad09748ee0",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"PasswordCollectorNode",
								"4457d0a4-748e-4844-8eab-d8ad09748ee0"
							]
						},
						"description": "Creates a new Password Collector Node."
					},
					"response": []
				},
				{
					"name": "Step 3: Create Username Collector Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"_id\":\"fd21c2f8-96b6-4d95-be2c-add3af72821a\"}"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/UsernameCollectorNode/fd21c2f8-96b6-4d95-be2c-add3af72821a",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"UsernameCollectorNode",
								"fd21c2f8-96b6-4d95-be2c-add3af72821a"
							]
						},
						"description": "Creates a new Username Collector Node."
					},
					"response": []
				},
				{
					"name": "Step 4: Create hCaptcha Node",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"captchaUri\": \"https://hcaptcha.com/siteverify\",\n  \"reCaptchaV3\": false,\n  \"apiUri\": \"https://hcaptcha.com/1/api.js\",\n  \"scoreThreshold\": \"0.5\",\n  \"divClass\": \"h-captcha\",\n  \"_id\": \"0abbfbe3-069a-4f86-91ed-ad298c950303\",\n  \"siteKey\": \"{{hcaptcha_sitekey}}\",\n  \"secretKey\": \"{{hcaptcha_secret_key}}\"\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/nodes/product-CaptchaNode/0abbfbe3-069a-4f86-91ed-ad298c950303",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"nodes",
								"product-CaptchaNode",
								"0abbfbe3-069a-4f86-91ed-ad298c950303"
							]
						},
						"description": "Creates a new CAPTCHA node configured for hCAPTCHA using the value of {{hcaptcha_sitekey}} and {{hcaptcha_secret_key}} for the sitekey and secret key respectively."
					},
					"response": []
				},
				{
					"name": "Step 5: Create hCaptcha Tree",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "accept-api-version",
								"value": "protocol=2.1,resource=1.0"
							},
							{
								"key": "content-type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"_id\": \"hcaptcha\",\n  \"entryNodeId\": \"fd21c2f8-96b6-4d95-be2c-add3af72821a\",\n  \"staticNodes\": {\n    \"startNode\": { \"x\": 50, \"y\": 58.04999542236328 },\n    \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\": { \"x\": 926, \"y\": 66 },\n    \"e301438c-0bd0-429c-ab0c-66126501069a\": { \"x\": 939, \"y\": 215 }\n  },\n  \"uiConfig\": {},\n  \"nodes\": {\n    \"5a3a92d3-912c-44e0-8ef4-33d3b5757eab\": {\n      \"displayName\": \"Data Store Decision\",\n      \"nodeType\": \"DataStoreDecisionNode\",\n      \"x\": 699,\n      \"y\": 21,\n      \"connections\": {\n        \"true\": \"70e691a5-1e33-4ac3-a356-e7b6d60d92e0\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    },\n    \"4457d0a4-748e-4844-8eab-d8ad09748ee0\": {\n      \"displayName\": \"Password Collector\",\n      \"nodeType\": \"PasswordCollectorNode\",\n      \"x\": 346.9666748046875,\n      \"y\": 58.05000305175781,\n      \"connections\": { \"outcome\": \"0abbfbe3-069a-4f86-91ed-ad298c950303\" }\n    },\n    \"fd21c2f8-96b6-4d95-be2c-add3af72821a\": {\n      \"displayName\": \"Username Collector\",\n      \"nodeType\": \"UsernameCollectorNode\",\n      \"x\": 151.18333435058594,\n      \"y\": 58.05000305175781,\n      \"connections\": { \"outcome\": \"4457d0a4-748e-4844-8eab-d8ad09748ee0\" }\n    },\n    \"0abbfbe3-069a-4f86-91ed-ad298c950303\": {\n      \"displayName\": \"hCAPTCHA\",\n      \"nodeType\": \"product-CaptchaNode\",\n      \"x\": 540,\n      \"y\": 36,\n      \"connections\": {\n        \"true\": \"5a3a92d3-912c-44e0-8ef4-33d3b5757eab\",\n        \"false\": \"e301438c-0bd0-429c-ab0c-66126501069a\"\n      }\n    }\n  }\n}\n"
						},
						"url": {
							"raw": "{{URL_base}}/json/realms/{{sub_realm}}/realm-config/authentication/authenticationtrees/trees/hcaptcha",
							"host": [
								"{{URL_base}}"
							],
							"path": [
								"json",
								"realms",
								"{{sub_realm}}",
								"realm-config",
								"authentication",
								"authenticationtrees",
								"trees",
								"hcaptcha"
							]
						},
						"description": "Creates a new tree containing the nodes created in steps 1 to 4. To login using this tree use the URL {{URL_base}}/XUI/?service=hcaptcha."
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "recaptcha_v3_sitekey",
			"value": ""
		},
		{
			"key": "recaptcha_v3_secret_key",
			"value": ""
		},
		{
			"key": "recaptcha_v2_sitekey",
			"value": ""
		},
		{
			"key": "recaptcha_v2_secret_key",
			"value": ""
		},
		{
			"key": "hcaptcha_sitekey",
			"value": ""
		},
		{
			"key": "hcaptcha_secret_key",
			"value": ""
		},
		{
			"key": "URL_base",
			"value": "http://openam.example.com:8080/openam"
		},
		{
			"key": "adminSSOToken",
			"value": ""
		},
		{
			"key": "sub_realm",
			"value": "captchaSubrealm"
		},
		{
			"key": "demo_username",
			"value": "forgerockDemo"
		},
		{
			"key": "demo_password",
			"value": "5up35tr0nG!"
		}
	]
}