Skip to main content

Authentication Overview

In Create Scan β†’ Step 2, you first choose whether the scan is Unauthenticated (crawl only the publicly reachable pages) or Authenticated (provide credentials so the scanner can reach pages behind login). When you pick Authenticated, the scanner shows four authentication methods β€” pick the one that matches how your app expects callers to prove who they are.

Decision tree​

If your app is…UseWhy
Public, no login (marketing site, open API)Unauthenticated ScanNothing to authenticate β€” scan the whole public surface.
An API that accepts a Bearer/JWT/API key headerToken BasedThe scanner attaches one header to every request.
A web app with a username + password formUsername and passwordThe scanner logs in once, captures the session, and replays it.
You already have a logged-in browser session you want to hand to the scannerBrowser sessionReuse an existing authenticated session β€” no credentials given to the scanner.
Complex, multi-step, or you don't want to encode selectorsAI-assisted loginAn LLM navigates the login flow for you.

Dashboard vs CLI vs YAML​

The same methods exist everywhere. The dashboard label is the user-facing card name; the CLI and YAML names are the underlying strategy keys.

MethodDashboard (Step 2)CLI flaglevo-dast.yml (auth.strategy)
UnauthenticatedUnauthenticated Scan card--auth nonenone
TokenToken Based card--auth token --token $TOKENtoken
Form loginUsername and password card--auth form --username … --password … --login-url …form
Browser sessionBrowser session card--auth-session-file ./session.json (or SHADOWNET_AUTH_SESSION_FILE)β€” (use the env var)
AI-assistedAI-assisted login card--auth aiai

The dashboard also exposes a "Login URL is the same as target URL" checkbox under Username and password β€” convenient when the login form is on the same URL you're scanning.

Pre-Auth values β€” shared across methods​

Three fields on the Authentication step apply regardless of which method you pick. Use them when your app needs state in place before the login request is sent:

  • Pre-Auth Cookies β€” CSRF tokens, tenant selectors, feature flags read by the login page.
  • Pre-Auth Headers β€” tenant headers (X-Tenant-Id), API gateway tokens, Accept-Language.
  • Local Storage Items / Local Storage Items (Base64) β€” SPA bootstrap data read on first load, or base64-encoded blobs.
Never put secrets in `levo-dast.yml`

Passwords, bearer tokens, raw cookie values, and API keys always come from a CLI flag or environment variable β€” never the YAML file. See the secrets policy.

Picking a test account​

  • Create a dedicated scan account in each environment β€” don't reuse a developer's account.
  • Give it the same role as a normal user (not admin) unless you want admin-only paths tested.
  • Expect the scan to submit forms, trigger emails, and change state. Keep it off production where possible β€” see Scanning production safely.

Next​

Was this page helpful?