0
0
Spring Bootframework~20 mins

JWT structure (header, payload, signature) in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
JWT Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
1:30remaining
What does the JWT header typically contain?
In a JWT token, the header part is a JSON object. What information does it usually hold?
AThe user's personal data like name and email
BThe signature to verify the token's authenticity
CThe expiration date and issued time of the token
DThe algorithm used for signing and the token type
Attempts:
2 left
💡 Hint
Think about what the system needs to know to verify the token's signature.
component_behavior
intermediate
1:30remaining
What is stored in the JWT payload?
The payload section of a JWT contains claims. What kind of information is typically stored here?
AThe algorithm used for signing the token
BThe secret key used to sign the token
CClaims about the user and token metadata like expiration
DThe encoded signature of the token
Attempts:
2 left
💡 Hint
Think about what data the server wants to share securely with the client.
📝 Syntax
advanced
1:30remaining
What is the correct order of JWT parts?
A JWT token is made of three parts separated by dots. What is the correct order of these parts?
ASignature, Header, Payload
BHeader, Payload, Signature
CPayload, Header, Signature
DPayload, Signature, Header
Attempts:
2 left
💡 Hint
Remember the token looks like three base64 strings separated by dots.
🔧 Debug
advanced
2:00remaining
Why does this JWT signature verification fail?
Given a JWT token, the signature verification fails in Spring Boot. Which of these is the most likely cause?
AThe secret key used to sign the token is different from the one used to verify it
BThe payload contains user data instead of metadata
CThe header is missing the 'typ' field
DThe token has three parts separated by dots
Attempts:
2 left
💡 Hint
Think about what must match exactly to verify a signature.
🧠 Conceptual
expert
2:00remaining
What is the role of the JWT signature?
Why is the signature part important in a JWT token?
AIt ensures the token has not been altered and confirms the sender's identity
BIt stores the user's password securely
CIt contains the expiration date of the token
DIt holds the user's profile information
Attempts:
2 left
💡 Hint
Think about how the server trusts the token's data.