Loading

Quipoin Menu

Learn • Practice • Grow

express-js / JWT Authentication in Express
mcq
Direction: Choose the correct option

Q1.

What does JWT stand for?
A. JavaScript Web Token
B. JSON Web Token
C. JSON With Token
D. Java Web Token
Direction: Choose the correct option

Q2.

Where is a JWT typically stored on the client side?
A. In a global variable
B. In localStorage or a cookie
C. In session storage
D. In the URL
Direction: Choose the correct option

Q3.

Which library is commonly used to sign and verify JWTs in Node.js?
A. passport-jwt
B. express-jwt
C. jwt-simple
D. jsonwebtoken
Direction: Choose the correct option

Q4.

What does jwt.sign(payload, secret) do?
A. Verifies a token
B. Creates a new JWT token with the given payload
C. Encrypts the payload
D. Decodes a token
Direction: Choose the correct option

Q5.

How do you extract a token from the Authorization header?
A. req.params.token
B. req.token
C. req.query.token
D. req.headers['authorization'].split(' ')[1]