Recall & Review
beginner
What does JWT stand for and what is its main purpose?
JWT stands for JSON Web Token. Its main purpose is to securely transmit information between parties as a JSON object, often used for authentication.
Click to reveal answer
beginner
How is a JWT typically structured?
A JWT has three parts separated by dots: Header, Payload, and Signature. The Header describes the token type and algorithm, the Payload contains claims, and the Signature verifies the token's integrity.
Click to reveal answer
beginner
In GraphQL, where is the JWT usually sent from the client to the server?
The JWT is usually sent in the HTTP Authorization header as a Bearer token when making GraphQL requests.
Click to reveal answer
intermediate
What is the role of the JWT signature in integration?
The signature ensures the token was not altered and verifies the sender's identity by using a secret or public/private key pair.
Click to reveal answer
intermediate
How can you verify a JWT in a GraphQL server resolver?
You decode the JWT from the Authorization header, verify its signature and expiration, then use the decoded data (like user ID) to control access or fetch user info.
Click to reveal answer
What part of a JWT contains the user information or claims?
✗ Incorrect
The Payload contains the claims or user information in a JWT.
How is a JWT usually sent in a GraphQL request?
✗ Incorrect
JWTs are typically sent in the HTTP Authorization header as Bearer tokens.
What does the JWT signature protect against?
✗ Incorrect
The signature ensures the token has not been tampered with.
Which algorithm is commonly used to sign JWTs?
✗ Incorrect
JWTs are commonly signed using RSA or HMAC algorithms.
What should a GraphQL server do if a JWT is expired?
✗ Incorrect
Expired JWTs should be rejected and the user asked to re-authenticate.
Explain how JWT integration works in a GraphQL API from client request to server verification.
Think about the steps from sending the token to checking it on the server.
You got /4 concepts.
Describe the structure of a JWT and the role of each part in security.
Consider how each part helps keep the token safe and trustworthy.
You got /3 concepts.