Loading

Quipoin Menu

Learn • Practice • Grow

spring / JWT Authentication
mcq
Direction: Choose the correct option

Q1.

What is JWT?
A. JSON Web Token, a compact token format for securely transmitting information
B. JavaScript Web Token
C. Java Web Token
D. None
Direction: Choose the correct option

Q2.

What are the three parts of a JWT?
A. Header, Payload, Signature
B. Header, Body, Signature
C. Header, Claims, Signature
D. Header, Payload, Key
Direction: Choose the correct option

Q3.

How is a JWT typically sent from client to server?
A. In the Authorization header as Bearer token
B. In a cookie
C. In request body
D. Any of the above
Direction: Choose the correct option

Q4.

What is the typical flow of JWT authentication in Spring?
A. Client sends credentials, server validates and returns JWT; subsequent requests include JWT
B. Server stores session
C. Client uses basic auth
D. None
Direction: Choose the correct option

Q5.

What library is commonly used for JWT in Spring?
A. jjwt
B. java-jwt
C. nimbus-jose-jwt
D. All of the above
Direction: Choose the correct option

Q6.

How do you validate a JWT token?
A. Parse and verify signature, check expiration, etc.
B. Check in database
C. Use OAuth
D. None
Direction: Choose the correct option

Q7.

What is a JwtAuthenticationFilter?
A. A filter that intercepts requests, validates JWT, and sets authentication in SecurityContext
B. A filter that creates JWT
C. A filter that logs out
D. None
Direction: Choose the correct option

Q8.

How do you configure Spring Security to use JWT?
A. Disable session management, add JWT filter, configure authentication provider
B. Use default login
C. Use OAuth2
D. None
Direction: Choose the correct option

Q9.

What is the purpose of a secret or private key in JWT?
A. To sign and verify the token's signature
B. To encrypt the payload
C. To generate header
D. None
Direction: Choose the correct option

Q10.

What is a refresh token in JWT authentication?
A. A long-lived token used to obtain new access tokens
B. A token to refresh the page
C. Same as access token
D. None