Skip to main content

Authentication

Testing behind a login? RoostGPT handles the full spectrum of authentication scenarios — from embedded login forms to Google OAuth and Okta SAML, including multi-factor authentication.

Supported Login Types

Login TypeConfigurationDescription
Embedded loginLOGIN_TYPE=embedded_loginStandard username/password forms — works with any form layout
Google OAuthLOGIN_TYPE=googleGoogle OAuth login flow
Okta SAMLLOGIN_TYPE=oktaOkta-based SAML authentication
Custom scriptPLAYWRIGHT_LOGIN_SCRIPT=pathYour own Playwright login script for non-standard auth
No authLOGIN_TYPE=noneApplication does not require authentication

Configuration

Basic Login

# In your .env file
LOGIN_TYPE=embedded_login
UI_SITE_USERNAME=testuser@example.com
UI_SITE_PASSWORD=your-test-password

OTP / Multi-Factor Authentication

Built-in support for time-based one-time passwords (TOTP):

UI_OTP_SECRET=YOUR_BASE32_TOTP_SECRET
UI_OTP_DIGITS=6
UI_OTP_ALGORITHM=sha1
UI_OTP_PERIOD=30

For non-standard OTP implementations, provide a custom script:

UI_OTP_SCRIPT_PATH=/path/to/otp-script.js
UI_OTP_SCRIPT_COMMAND=node

:::note Credential Security Passwords and OTP secrets are stored securely and never appear in plaintext in generated test files or reports. :::

Session Reuse

Authenticated sessions are automatically preserved and reused across tests, dramatically reducing execution time. RoostGPT logs in once, saves the session state, and restores it for subsequent tests — re-running the login flow only when the session has expired.

Dedicated Login Tests

RoostGPT automatically generates login test scenarios that verify your authentication flow itself — including successful login, redirect behavior, and session persistence. These are generated separately from workflow tests and run first to establish the authenticated session.

Next Steps