OpenQAOpenQA
Configuration

Authentication

Configure how OpenQA authenticates with your application to test protected areas.

Authentication Types

TypeUse Case
nonePublic pages only, no authentication needed
basicHTTP Basic Authentication
sessionForm-based login (most common)

No Authentication

For testing public pages only:

bash
curl -X POST http://localhost:3000/api/saas-config \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Public Site",
    "description": "Public website with no login required",
    "url": "https://my-site.com",
    "auth": {
      "type": "none"
    }
  }'

Basic Authentication

For sites using HTTP Basic Auth:

bash
curl -X POST http://localhost:3000/api/saas-config \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Protected Site",
    "description": "Site with basic auth",
    "url": "https://my-site.com",
    "auth": {
      "type": "basic",
      "credentials": {
        "username": "admin",
        "password": "secretpassword"
      }
    }
  }'

Session Authentication

For sites with form-based login (most web apps):

bash
curl -X POST http://localhost:3000/api/saas-config \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My SaaS App",
    "description": "App with user login",
    "url": "https://my-app.com",
    "auth": {
      "type": "session",
      "credentials": {
        "username": "test@example.com",
        "password": "testpassword"
      }
    }
  }'

💡 Tip: Create a dedicated test account for OpenQA. Don't use production credentials or admin accounts.

How Session Auth Works

When using session authentication, OpenQA will:

  1. Navigate to your login page
  2. Find the login form automatically
  3. Fill in the username and password
  4. Submit the form
  5. Store the session cookie for subsequent requests

Custom Login Flow

If your login flow is non-standard, you can provide additional hints:

bash
curl -X POST http://localhost:3000/api/saas-config \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My App",
    "description": "App with custom login",
    "url": "https://my-app.com",
    "auth": {
      "type": "session",
      "credentials": {
        "username": "test@example.com",
        "password": "testpassword"
      },
      "loginUrl": "/auth/signin",
      "usernameField": "email",
      "passwordField": "pass",
      "submitButton": "#login-btn"
    }
  }'

Environment Variables

You can also configure auth via environment variables:

bash
SAAS_AUTH_TYPE=session
SAAS_USERNAME=test@example.com
SAAS_PASSWORD=testpassword

Security Best Practices

✅ Use a Dedicated Test Account

Create a separate account for OpenQA testing with limited permissions

✅ Use Environment Variables

Store credentials in .env file, not in API calls

✅ Test on Staging First

Run OpenQA against staging/test environments before production

❌ Never Use Admin Credentials

Don't give OpenQA admin access - use a regular user account

Next Steps