Skip to main content
AI agents are now live in Website Scanner! Enter your URL and fix website issues 3x faster with AI. Explore now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

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

POST /api/website-scanner/v1/auth_configs

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 form for form-based authentication.

  • authData* Object

    The credentials and selectors required for form-based authentication.

    â–¶ SHOW VALUES
    • username String

      The username credential. Required for both basic and form_2 types.

    • password String

      The password credential. Required for both basic and form_2 types.

    • url String

      The login page URL. Required for form_2 type only.

    • usernameSelector String

      The CSS selector for the username input field. Required for form_2 type only.

    • passwordSelector String

      The CSS selector for the password input field. Required for form_2 type only.

    • submitSelector String

      The CSS selector for the form submit button. Required for form_2 type 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

    The created authentication configuration object.

    â–¶ SHOW VALUES
    • id Integer

      The unique ID of the newly created authentication configuration.

    • name String

      The name of the authentication configuration.

    • type String

      The authentication type (basic or form_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_2 type.

    • usernameSelector String

      The CSS selector for the username field. Present only for form_2 type.

    • passwordSelector String

      The CSS selector for the password field. Present only for form_2 type.

    • submitSelector String

      The CSS selector for the submit button. Present only for form_2 type.

create auth config for basic auth

POST /api/website-scanner/v1/auth_configs

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 basic for HTTP basic authentication.

  • authData* Object

    The credentials required for HTTP basic authentication.

    â–¶ SHOW VALUES
    • username String

      The username credential. Required for both basic and form_2 types.

    • password String

      The password credential. Required for both basic and form_2 types.

    • url String

      The login page URL. Required for form_2 type only.

    • usernameSelector String

      The CSS selector for the username input field. Required for form_2 type only.

    • passwordSelector String

      The CSS selector for the password input field. Required for form_2 type only.

    • submitSelector String

      The CSS selector for the form submit button. Required for form_2 type 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

    The created authentication configuration object.

    â–¶ SHOW VALUES
    • id Integer

      The unique ID of the newly created authentication configuration.

    • name String

      The name of the authentication configuration.

    • type String

      The authentication type (basic or form_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_2 type.

    • usernameSelector String

      The CSS selector for the username field. Present only for form_2 type.

    • passwordSelector String

      The CSS selector for the password field. Present only for form_2 type.

    • submitSelector String

      The CSS selector for the submit button. Present only for form_2 type.

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.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle