Skip to content

Auth: per-route API marker — separate credential source from challenge presentation #121

Description

@mgrossmann

Follow-up to #119 (PR #120), part of the auth-redesign cleanup tracked under #105.

Background

#119 / PR #120 fixed the immediate problem — the native Basic-auth popup that re-introduced browser-side Basic credentials and defeated token logout — by suppressing WWW-Authenticate: Basic when the request carries the z/OSMF CSRF marker (X-CSRF-ZOSMF-HEADER). That is a client-driven heuristic: it works because our SPA and Zowe always send the marker, but it is our own convention, not a server-declared property of the route.

Empirical note from #119: real z/OSMF does not use this header — it sends WWW-Authenticate: Basic on its REST API 401s regardless. So the heuristic is a deliberate "better than stock z/OSMF" choice, not a compatibility contract.

The deeper design smell

The AUTH=BASIC mode conflates two independent things:

  • credential source — "I accept Authorization: Basic"
  • challenge presentation — "I advertise WWW-Authenticate: Basic"

An API route wants the former without the latter, deterministically, regardless of what the client sends.

Proposal

Introduce a server-declared, per-route API marker so an operator can mark a route as API → its 401 is always a bare 401 (no WWW-Authenticate), independent of request headers. Candidate spellings (decide during design):

Note the parser (httpprm.c parse_kv_tail) currently accepts only NONE|FORM|BASIC#98 documented AUTH=BASIC,TOKEN but that comma-list / TOKEN keyword was never built. This issue finishes that piece.

Scope

Not blocking

#120 already unblocks the SPA token model. This is the clean, deterministic long-term form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:cleanupRefactoring or tech debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions