Create auth config API in Website Scanner
Use this API to set up basic or form authorization for your website scans.
You can create two types of auth configs:
- form auth
- basic auth
create auth config for form auth
If Geo Region Restriction (GRR) is enabled for your account, add your region code to the host name:
api-accessibility-<region>.browserstack.com. See Geo Region Restriction endpoints for the region codes and examples.
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-accessibility.browserstack.com/api/website-scanner/v1/auth_configs" \
-H "Content-Type: application/json" \
-d '{
"authData": {
"password": "user",
"passwordSelector": "user",
"submitSelector": "ack",
"url": "https://sampleurl.com",
"username": "somo",
"usernameSelector": "somo"
},
"name": "sample_auth_config",
"type": "form"
}'
Response Attributes 200 OK JSON
Response
{
"success": true,
"data": {
"id": 16,
"name": "sample_auth_config",
"type": "form",
"username": "somo",
"password": "user",
"url": "https://google.com",
"usernameSelector": "somo",
"passwordSelector": "user",
"submitSelector": "ack"
}
}
create auth config for basic auth
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-accessibility.browserstack.com/api/website-scanner/v1/auth_configs" \
-H "Content-Type: application/json" \
-d '{
"name": "sample_auth_config1",
"type": "basic",
"authData": {
"url": "https://sampleurl.com",
"username": "somo",
"password": "user"
}
}'
Response Attributes 200 OK JSON
Response
{
"success": true,
"data": {
"id": 16,
"name": "sample_auth_config1",
"type": "basic",
"username": "somo",
"password": "user"
}
}
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.