Recall & Review
beginner
What does JWT stand for and what is its main purpose?
JWT stands for JSON Web Token. It is used to securely transmit information between parties as a JSON object, often for authentication and authorization.
Click to reveal answer
beginner
In Spring Boot, which library is commonly used to create and verify JWT tokens?
The 'jjwt' library (io.jsonwebtoken) is commonly used in Spring Boot to create and verify JWT tokens easily.
Click to reveal answer
beginner
What are the three parts of a JWT token?
A JWT token has three parts separated by dots: Header (token type and algorithm), Payload (claims or data), and Signature (to verify token integrity).
Click to reveal answer
intermediate
Which Spring Boot component typically holds the secret key used for signing JWT tokens?
The secret key is usually stored in application.properties or environment variables and injected into the JWT utility class for signing tokens.Click to reveal answer
beginner
What is the purpose of the 'claims' in JWT generation?
Claims are pieces of information (like user ID, roles, expiration) stored in the JWT payload to convey user identity and permissions.
Click to reveal answer
Which part of the JWT contains the user's data like username or roles?
✗ Incorrect
The Payload part of the JWT contains the claims, which hold user data like username or roles.
In Spring Boot, which method is commonly used to sign a JWT token?
✗ Incorrect
The signWith() method from the jjwt library is used to sign the JWT token with a secret key.
What does the JWT signature ensure?
✗ Incorrect
The signature ensures the token has not been altered and is valid.
Where is the secret key for JWT signing usually stored in a Spring Boot app?
✗ Incorrect
The secret key is stored securely in application.properties or environment variables, not in the token itself.
Which algorithm is commonly used to sign JWT tokens in Spring Boot?
✗ Incorrect
HS256 (HMAC with SHA-256) is a common algorithm used to sign JWT tokens.
Explain the process of generating a JWT token in a Spring Boot application.
Think about the steps from user info to a signed token string.
You got /5 concepts.
Describe the structure of a JWT token and the role of each part.
Remember the token has three parts separated by dots.
You got /3 concepts.