Loading

Quipoin Menu

Learn • Practice • Grow

express-js / Express.js Authentication Basics
mcq
Direction: Choose the correct option

Q1.

What is authentication in web applications?
A. The process of logging activities
B. The process of determining what a user can access
C. The process of encrypting data
D. The process of verifying the identity of a user
Direction: Choose the correct option

Q2.

Which HTTP header is commonly used to send credentials like tokens?
A. Token
B. Authentication
C. Cookie
D. Authorization
Direction: Choose the correct option

Q3.

What is the difference between authentication and authorization?
A. Authentication verifies identity, authorization determines permissions
B. Authentication is for users, authorization is for servers
C. They are the same
D. Authentication is done first, then authorization later
Direction: Choose the correct option

Q4.

Which middleware can be used to protect routes and check if a user is logged in?
A. express.auth()
B. A custom middleware that checks req.session or req.user
C. express.protect()
D. express.session()
Direction: Choose the correct option

Q5.

What is a common way to store user passwords in a database?
A. As a hashed string using bcrypt
B. As a base64 encoded string
C. As plain text
D. As encrypted text