Summary
The deployed httpd gates /zosmf/services/authenticate under the /zosmf/*
AUTH=BASIC route policy, so auth_gate() rejects an unauthenticated
request to the authenticate endpoint with httpd's own 401 before dispatching
to the mvsMF CGI. Per the Auth redesign (docs/auth-redesign.md §2.5, #98) the
authenticate route was meant to "resolve but not reject" — i.e. resolve any
credential but always pass through, so mvsMF owns the login/logout response.
This is a design/config gap, not a functional blocker (see Impact) — filing
it so the httpd team can decide whether to close the gap or accept the current
behavior.
Behavior today (live, mvsdev.lan:1081)
A bad-credential POST /zosmf/services/authenticate gets httpd's generic 401,
never reaching mvsMF:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="MVS"
Server: HTTPD Server <- httpd's auth_gate, not the CGI
Content-Type: text/plain
401 Unauthorized
mvsMF's handler would instead return the z/OSMF-shaped body:
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{"returnCode":8,"reasonCode":1,"message":"Login failed. ..."}
Same for DELETE without a token (httpd 401 before the CGI).
Impact — mostly cosmetic
- Valid login is unaffected: the resolver sets
httpc->cred from valid
Basic, the gate passes, mvsMF returns 200 + LtpaToken2. ✔
- Bad login still returns 401 (correct status); only the body differs
(httpd text/plain vs. mvsMF's z/OSMF JSON). Zowe/z/OSMF clients act on the
status code, not the body — so no functional breakage.
- Logout without a valid token → 401 is actually correct per the z/OSMF
spec ("request cookie must include a valid token").
What is lost by gating the route:
- mvsMF cannot emit the exact z/OSMF wire format (
returnCode/reasonCode/
message) on the login-failure path.
- The login endpoint answers with
WWW-Authenticate: Basic realm="MVS" —
real z/OSMF's /zosmf/services/authenticate does not send a challenge on
this endpoint (it hands back a JSON result), and a Basic challenge can trigger
a browser-native credential dialog for some client types.
Suggested fix
Give /zosmf/services/authenticate a more-specific route with AUTH=NONE
(overriding the broader /zosmf/* AUTH=BASIC). resolve_credential() runs for
every request before auth_gate(), so a valid Basic/token still populates
httpc->cred; AUTH=NONE just stops the gate from rejecting, letting every
request reach mvsMF, which then owns the response (200 + token on success, the
z/OSMF 401 on failure, 204/handled logout). This mirrors how httpd's own
/login and /logout are dispatched before the gate (see the
is_asset_exempt() note in src/httppc.c).
Decision for the team
Is exact z/OSMF wire fidelity (and no Basic challenge) on the authenticate
endpoint worth the extra route, or is httpd's front-gate 401 acceptable? If the
latter, this is wontfix and mvsMF's failure-path handler is effectively dead
code (harmless) — we'd relax the mvsMF tests accordingly.
References
Summary
The deployed httpd gates
/zosmf/services/authenticateunder the/zosmf/*AUTH=BASICroute policy, soauth_gate()rejects an unauthenticatedrequest to the authenticate endpoint with httpd's own 401 before dispatching
to the mvsMF CGI. Per the Auth redesign (
docs/auth-redesign.md§2.5, #98) theauthenticate route was meant to "resolve but not reject" — i.e. resolve any
credential but always pass through, so mvsMF owns the login/logout response.
This is a design/config gap, not a functional blocker (see Impact) — filing
it so the httpd team can decide whether to close the gap or accept the current
behavior.
Behavior today (live,
mvsdev.lan:1081)A bad-credential
POST /zosmf/services/authenticategets httpd's generic 401,never reaching mvsMF:
mvsMF's handler would instead return the z/OSMF-shaped body:
Same for
DELETEwithout a token (httpd 401 before the CGI).Impact — mostly cosmetic
httpc->credfrom validBasic, the gate passes, mvsMF returns 200 +
LtpaToken2. ✔(httpd
text/plainvs. mvsMF's z/OSMF JSON). Zowe/z/OSMF clients act on thestatus code, not the body — so no functional breakage.
spec ("request cookie must include a valid token").
What is lost by gating the route:
returnCode/reasonCode/message) on the login-failure path.WWW-Authenticate: Basic realm="MVS"—real z/OSMF's
/zosmf/services/authenticatedoes not send a challenge onthis endpoint (it hands back a JSON result), and a Basic challenge can trigger
a browser-native credential dialog for some client types.
Suggested fix
Give
/zosmf/services/authenticatea more-specific route withAUTH=NONE(overriding the broader
/zosmf/* AUTH=BASIC).resolve_credential()runs forevery request before
auth_gate(), so a valid Basic/token still populateshttpc->cred;AUTH=NONEjust stops the gate from rejecting, letting everyrequest reach mvsMF, which then owns the response (200 + token on success, the
z/OSMF 401 on failure, 204/handled logout). This mirrors how httpd's own
/loginand/logoutare dispatched before the gate (see theis_asset_exempt()note insrc/httppc.c).Decision for the team
Is exact z/OSMF wire fidelity (and no Basic challenge) on the authenticate
endpoint worth the extra route, or is httpd's front-gate 401 acceptable? If the
latter, this is wontfix and mvsMF's failure-path handler is effectively dead
code (harmless) — we'd relax the mvsMF tests accordingly.
References
src/httppc.c:auth_gate()(~L346),auth_required_response()(~L396),resolve_credential()(~L268),is_asset_exempt()(~L326)docs/auth-redesign.md§2.5 · per-route policy Auth 3/6 (httpd): per-route auth policy in MOD= + challenge decoupling #98 · Epic Epic: Auth redesign (Form + Basic + z/OSMF token, per-route policy, HTTPX export) #100