

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: What Is a Message Integrity?
incomplete
2: Message Authentication Code (MAC)
incomplete
3: Message Authentication Code (MAC)
incomplete
4: Hash-Based Message Authentication Code
incomplete
5: Toy HMAC
incomplete
6: MACs and JWTs
incomplete
7: Asymmetric JWTs
incomplete
8: Asymmetric JWT Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Asymmetric JWTs use a private key to sign the JSON payload, and a public key to validate it, it's similar to asymmetric encryption. but instead of encrypting data, we're signing it.
Symmetric JWTs use the same key to sign and validate the tokens.
An example of "Sign in with Google":
User clicks "Sign in with Google" and enters their credentials
If the credentials are valid, Google creates a JWT by signing it with their private key
The signed JWT is given to the client
The client sends the JWT in an HTTP header along with every request that requires authentication
The Boot.dev server uses Google's public key to validate the JWT in each subsequent request
ECDSA is just one signing algorithm that can be used with asymmetric JWTs. There are many others, including RSA.
An example of signing into a website with a username and password:
User clicks "Sign in" and enters their credentials
If the credentials are valid, the server creates a JWT by signing it with its secret key
The signed JWT is sent to the client
The Boot.dev server uses the same secret key again to validate the JWT in each subsequent request