Pcornel
Automation · APIs

Basic Authentication

Cheat sheet · https://pcornel.dk/topic.php?topic=5313

Back to the Topic

Answer

HTTP Basic authentication using a username/password credential encoded for transmission and protected by TLS.

Remember

  • Base64 ≠ encryption; Basic credentials are trivially recoverable from the header without transport protection.
  • TLS present ≠ credential least privilege; password scope, sharing and rotation still matter.
  • 401 challenge ≠ credentials definitely wrong; realm, proxy or authentication routing can be involved.
  • Basic auth success ≠ session isolation; every request typically carries reusable credentials.

First checks

  • curl -sS -u <user>:<password> <url> — basic auth
  • HTTPS only — transport
  • Service account, not personal — identity

Verify in this order

user:pass → base64 header → TLS → API

Where it usually breaks

A successful Basic challenge proves credential acceptance for that request; it does not make Base64 confidential or prove least privilege.

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

Basic Authentication API boundary map

BoundaryHealthy evidenceSuspicious evidence
Caller / requestEnvironment/version, identity and exact request contract are attributableHidden defaults, wrong endpoint/version, leaked or mismatched credentials
Server / responseStatus, headers, structured body and request ID are interpreted togetherStatus-only handling, ignored error body, ambiguous async result or unsafe retry
State / proofWrite result is reconciled with resource read-back or acceptance testResponse success treated as final target success without verification
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind retries, credential rotation, replay or payload edits before evidence is captured

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5313

Confirmation

Confirm action

Continue?