Recall & Review
beginner
What is a refresh token in web authentication?
A refresh token is a special token used to get a new access token without asking the user to log in again. It helps keep users logged in smoothly.
Click to reveal answer
beginner
Why do we use refresh tokens instead of long-lived access tokens?
Refresh tokens improve security by keeping access tokens short-lived. If an access token is stolen, it expires quickly, reducing risk.
Click to reveal answer
intermediate
How does the refresh token flow work in Express apps?
When the access token expires, the client sends the refresh token to the server. The server verifies it and issues a new access token.
Click to reveal answer
intermediate
Where should refresh tokens be stored on the client side?
Refresh tokens should be stored securely, often in HTTP-only cookies, to prevent access by JavaScript and reduce risk of theft.
Click to reveal answer
advanced
What happens if a refresh token is compromised?
If a refresh token is stolen, an attacker can get new access tokens. To reduce risk, refresh tokens should be revocable and have expiration.
Click to reveal answer
What is the main purpose of a refresh token?
✗ Incorrect
Refresh tokens allow clients to request new access tokens without asking the user to log in again.
Where is it safest to store a refresh token on the client?
✗ Incorrect
HTTP-only cookies prevent JavaScript access, reducing risk of token theft.
What should happen when a refresh token is used to get a new access token?
✗ Incorrect
The server checks the refresh token's validity before issuing a new access token.
Why are access tokens usually short-lived?
✗ Incorrect
Short-lived tokens limit the time an attacker can use a stolen token.
What is a risk if refresh tokens are not revoked after logout?
✗ Incorrect
Not revoking refresh tokens allows attackers to keep getting new access tokens.
Explain how refresh tokens help maintain user sessions securely in an Express app.
Think about how users stay logged in without re-entering passwords.
You got /4 concepts.
Describe best practices for storing and handling refresh tokens on the client and server.
Focus on security and preventing token theft.
You got /4 concepts.