A parks-department dashboard calls a Cisco API with a Bearer token, receives HTTP 401, then retries after a token refresh that the authorization server also rejects. What is the correct control-flow choice?
Select an answer to reveal the explanation.
Short Explanation
If both the door badge and the badge printer say no, standing at the turnstile and swiping forever does not help. Once the token hop has already failed, the consumer stops—it does not spin endless 401s.
Full Explanation
A missing or rejected Bearer token on a resource call is not cured by replaying the same Authorization header. When the parks-department dashboard receives HTTP 401, attempts a structured token refresh, and the authorization server also rejects that grant, authentication is exhausted. The correct control-flow choice is to fail closed: abort that call path, surface an auth failure to the operator or job framework, and stop looping on 401 responses. Continuing would only hammer the Cisco API and the token endpoint with credentials that are already known to be invalid.
Keeping resending the same rejected Authorization header until a success status appears fails because the platform has already declared the credential unusable; infinite replay wastes quotas and can look like an attack pattern. Treating every 401 as a transient network glitch and applying timeout-style exponential backoff fails by concept—401 is an application-layer auth outcome, not a transport timeout or 503. Stripping the Authorization header and retrying anonymously fails because privileged Cisco inventory or health endpoints will not suddenly authorize an unauthenticated client; you merely convert one failure mode into another (often 401/403) while leaking that the client is willing to drop auth under pressure.
Exam caveat: a single 401 followed by one successful refresh-and-retry can still be correct; the fail-closed rule applies after re-auth is exhausted or when no usable grant remains. Distinguish 401 (authenticate) from 403 (authenticated but not permitted)—only the former is about the token hop.
Operational check: verify the dashboard’s client stops after the refresh failure, emits a clear auth-exhausted metric or alert, and never shows a silent empty success for the Cisco call that never authenticated.