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"
}'
-
name* String
A descriptive name for the authentication configuration.
-
type* String
The authentication type. Use
formfor form-based authentication. -
authData* Object
â–¶ SHOW VALUESThe credentials and selectors required for form-based authentication.
-
username String
The username credential. Required for both
basicandform_2types. -
password String
The password credential. Required for both
basicandform_2types. -
url String
The login page URL. Required for
form_2type only. -
usernameSelector String
The CSS selector for the username input field. Required for
form_2type only. -
passwordSelector String
The CSS selector for the password input field. Required for
form_2type only. -
submitSelector String
The CSS selector for the form submit button. Required for
form_2type only.
-
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"
}
}
-
success Boolean
Indicates whether the request was successful.
-
data Object
â–¶ SHOW VALUESThe created authentication configuration object.
-
id Integer
The unique ID of the newly created authentication configuration.
-
name String
The name of the authentication configuration.
-
type String
The authentication type (
basicorform_2). -
username String
The username stored in the authentication configuration.
-
password String
The password stored in the authentication configuration.
-
url String
The login page URL. Present only for
form_2type. -
usernameSelector String
The CSS selector for the username field. Present only for
form_2type. -
passwordSelector String
The CSS selector for the password field. Present only for
form_2type. -
submitSelector String
The CSS selector for the submit button. Present only for
form_2type.
-
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"
}
}'
-
name* String
A descriptive name for the authentication configuration.
-
type* String
The authentication type. Use
basicfor HTTP basic authentication. -
authData* Object
â–¶ SHOW VALUESThe credentials required for HTTP basic authentication.
-
username String
The username credential. Required for both
basicandform_2types. -
password String
The password credential. Required for both
basicandform_2types. -
url String
The login page URL. Required for
form_2type only. -
usernameSelector String
The CSS selector for the username input field. Required for
form_2type only. -
passwordSelector String
The CSS selector for the password input field. Required for
form_2type only. -
submitSelector String
The CSS selector for the form submit button. Required for
form_2type only.
-
Response attributes 200 OK JSON
Response
{
"success": true,
"data": {
"id": 16,
"name": "sample_auth_config1",
"type": "basic",
"username": "somo",
"password": "user"
}
}
-
success Boolean
Indicates whether the request was successful.
-
data Object
â–¶ SHOW VALUESThe created authentication configuration object.
-
id Integer
The unique ID of the newly created authentication configuration.
-
name String
The name of the authentication configuration.
-
type String
The authentication type (
basicorform_2). -
username String
The username stored in the authentication configuration.
-
password String
The password stored in the authentication configuration.
-
url String
The login page URL. Present only for
form_2type. -
usernameSelector String
The CSS selector for the username field. Present only for
form_2type. -
passwordSelector String
The CSS selector for the password field. Present only for
form_2type. -
submitSelector String
The CSS selector for the submit button. Present only for
form_2type.
-
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.