👨‍Shadab Perwez · API Authentication Workshop
📧 shadab.perwez@wilp.bits-pilani.ac.in  ·  🌐 140.245.218.78

🔐 Auth Playground — Step-by-Step Visualizer

Click through each auth flow to see exactly what happens: how credentials are encoded, how the request packet travels to the server, which lines of code run, and how the response returns to the client.

step in progress step succeeded step failed step not started yet

Basic Authentication — 6 steps

🖥️ Client (browser)

Step 1 · Combine
alice:password123
Step 2 · Base64-encode
YWxpY2U6cGFzc3dvcmQxMjM=
Step 3 · Build HTTP header
Authorization: Basic YWxp…

🌐 Network

🔒
HTTPS in production — base64 is NOT encryption!

🛠️ Server (Flask)

Step 4 · Parse header
request.headers["Authorization"]
Step 5 · Base64-decode + split
base64.b64decode(...).split(":", 1)
Step 6 · Check USERS dict
USERS.get(user) == password
📄 Server code that runs:
@app.route("/basic") def basic_auth(): auth = request.headers.get("Authorization") encoded = auth.split(" ")[1] decoded = base64.b64decode(encoded).decode("utf-8") username, password = decoded.split(":", 1) if USERS.get(username) != password: return jsonify({"error": "Invalid ..."}), 401 return jsonify({"message": f"Hello {username}!"})
📬 Server response:
// click "Run" above