Script Valley
REST API Development: Complete Course from Beginner to Production
Authentication and Security in REST APIs/Assessment

Practice & Assessment

Test your understanding of Authentication and Security in REST APIs

Multiple Choice Questions

5
1

What are the three parts of a JSON Web Token?

2

Why should API keys be stored as hashes rather than plaintext in the database?

3

What security vulnerability does express-mongo-sanitize protect against?

4

What is the recommended bcrypt salt factor for production password hashing?

5

Why is storing JWT tokens in localStorage considered a security risk?

Mini Project

1

Secure User Authentication and Authorization System

Build a production-grade authentication system including: user registration with email verification, login with JWT access and refresh tokens, password reset via email link, Google OAuth login using Passport.js, three roles (user, moderator, admin) with RBAC middleware, API key generation for programmatic access (store hashed), account lockout after 5 failed login attempts, all security middleware (helmet, CORS whitelist, rate limiting, mongo-sanitize, xss-clean), and comprehensive tests for all authentication flows.

Hard
Practice & Assessment โ€” Authentication and Security in REST APIs โ€” REST API Development: Complete Course from Beginner to Production โ€” Script Valley โ€” Script Valley