Skip to content

Authentication-config failure leaves the frontend in an authorization dead end #2441

Description

@romanlutz

Describe the bug

If /api/auth/config fails while protected APIs return 401, the frontend treats authentication as disabled and renders the normal Home and Configuration surfaces with raw Missing or invalid Authorization header text. No login control, explicit authentication-initialization error, or viable recovery path appears.

fetchAuthConfig() converts non-2xx responses and network failures into an empty auth configuration, which AuthProvider interprets as authentication being disabled. This produces a mixed normal-shell/unauthorized state. See msalConfig.ts lines 26-37.

Steps/Code to Reproduce

  1. Make the authentication configuration request return 503.
  2. Make protected API requests return 401.
GET /api/auth/config
HTTP/1.1 503 Service Unavailable

GET /api/targets?limit=200
HTTP/1.1 401 Unauthorized

{"detail":"Missing or invalid Authorization header"}
  1. Open Home and Configuration.
  2. Observe repeated failed requests, raw authorization text, and no Login action.
  3. Choose Configuration's Refresh action and observe that it retries target data but cannot recover authentication.

Expected Results

The app presents an explicit authentication-initialization failure with a retry action and/or the configured login path. It should distinguish a failed auth-config request from an intentional auth-disabled configuration.

Actual Results

The normal application shell renders in an unauthorized state:

Home: Missing or invalid Authorization header
Configuration: Error: Missing or invalid Authorization header
Login controls: 0
Authentication-state errors: 0

The generic Configuration refresh cannot repair the authentication state.

Screenshots

N/A. The exact visible output and response sequence are included above.

Versions

  • OS: Windows
  • Browser: Playwright Chromium (@playwright/test 1.62.1)
  • Python: 3.14.4
  • PyRIT: main at 37bb7377ec3f8ed547b9a52f4536447c097e0f33

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions