Skills101
← All practice quizzes

Quiz: Authentication, Sessions and JWT

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

How login really works. Hash passwords with a salt, compare session-cookie login with JWT tokens, build and verify a JWT by hand to see why it can't be forged, and learn the difference between authentication and authorization.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    A logged-in student tries to open the admin dashboard. Which concept is being checked?

  2. Question 2

    Why do we add a random salt to each password before hashing?

  3. Question 3

    Which is a suitable password-hashing algorithm?

  4. Question 4

    What does this print?

    const payload = Buffer.from(JSON.stringify({ sub: 42, role: "student" })).toString("base64url");
    console.log(JSON.parse(Buffer.from(payload, "base64url").toString()).role);
    
  5. Question 5

    An attacker changes the role inside a JWT payload from "student" to "admin". What stops this from working?

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →