JWT Flashcards

1
Q

A JWT contains three parts

A

—a header (x), a payload (y), and a signature (z)—that are separated by a dot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

The header of the JWT consists of

A

two parts:
1) the type of token
and
2) the signing algorithm being used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

he signing algorithm is used to

A

ensure that the message is authentic and not altered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

an example of a JWT header:

A

{
“alg”: “RSA”,
“typ”: “JWT”
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Signing algorithms are

A

algorithms used to sign tokens issued for your application or API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The payload is the second part of a JWT that

A

contains the claims

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

a JWT payload claim is

A

a statement (pair of key:value) about an entity (typically, the user) and additional data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

an example of a JWT payload :

A

{
“id”: “d1397699-f37b-4de0-8e00-948fa8e9bf2c”,
“name”: “John Doe”,
“admin”: true
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The signature of a JWT is

A

the encoded header,
the encoded payload plus a secret,
and an algorithm specified in the header,

all of them combined and signed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Example of a signature of a JWT using RSA algorithm:

A

RSA(
base64UrlEncode(header) + “.” +
base64UrlEncode(payload),
secret)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The role of a JWT signature is to

A

track whether information has been changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens Each time a user successfully logs in and JWT is being used?

A

a JWT is created and returned. The JWT will be represented as credentials used to access protected resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

why we should specify an expiration time when creating a JWT?

A

The fact that it’s possible to store data in a JWT makes it vulnerable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s the purpose of an Access token?

A

Used to access resources and handle authorization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s the purpose of a Refresh token?

A

Used to retrieve a new access token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens after the JWT has expired?

A

the user has to log in again

16
Q

What’s necessary after just some minutes of session, to avoid a login ?

A

a refresh token: It’ll contain the essential information needed to verify the user and generate a new access token.