🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Authentication, Sessions and JWT: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. A logged-in student tries to open the admin dashboard. Which concept is being checked?
  2. Q2. Why do we add a random salt to each password before hashing?
  3. Q3. Which is a suitable password-hashing algorithm?
  4. Q4. What does this print? (code)
  5. Q5. An attacker changes the role inside a JWT payload from "student" to "admin". What stops this from working?
  6. Q6. What are the three parts of a JWT, in order?
  7. Q7. Why is logging a user out immediately harder with JWTs than with server-side sessions?
  8. Q8. Where is it risky to keep a login token in the browser?
  9. Q9. GET /api/results/1043 returns a result that belongs to a different student. What check is missing?
  10. Q10. Which login error message is better for security?