Skip to main content
No Result Found

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 https://api-accessibility.browserstack.com/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 '{
       "authData": {
         "password": "user",
         "passwordSelector": "user",
         "submitSelector": "ack",
         "url": "https://sampleurl.com",
         "username": "somo",
         "usernameSelector": "somo"
       },
       "name": "sample_auth_config",
       "type": "form"
     }'
  • name* String

    A name given to the auth config.

  • type* String

    The type of authentication, “form” for form authentication.

  • authData* Object

    Fields required to set up form authentication

    SHOW VALUES
    • username* String

      The user name to be filled.

    • usernameSelector* String

      The selector of the username field.

    • password* String

      The password to be filled.

    • passwordSelector* String

      The selector of the password field.

    • submitSelector* String

      The selector of the submit button after entering user name and password.

    • url* String

      The URL of the authentication page.

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

    True, if the auth config is created.

  • data Object

    Fields required to set up form authentication

    SHOW VALUES
    • configId Integer

      A unique ID created for the auth config.

    • type String

      Type of auth, should be “form”.

    • username String

      The username to be filled.

    • usernameSelector String

      The selector of the username field.

    • password String

      The password to be filled.

    • passwordSelector String

      The selector of the password field.

    • submitSelector String

      The selector of the submit button after entering user name and password.

    • url String

      The URL of the authentication page.

create auth config for basic auth

POST https://api-accessibility.browserstack.com/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 name given to the auth config.

  • type* String

    The type of authentication, “basic” for basic authentication.

  • authData* Object

    Fields required to set up basic authentication

    SHOW VALUES
    • url* String

      The URL of the authentication page.

    • username* String

      The user name to be filled.

    • password* String

      The password to be filled.

Response Attributes 200 OK JSON

Response

{
    "success": true,
    "data": {
        "id": 16,
        "name": "sample_auth_config1",
        "type": "basic",
        "username": "somo",
        "password": "user"
    }
}
  • success Boolean

    True, if the auth config is created.

  • data Object

    Fields of basic authentication

    SHOW VALUES
    • configId Integer

      A unique ID created for the auth config.

    • type String

      Type of auth, should be “basic”.

    • username String

      The username to be filled.

    • password String

      The password to be filled.

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