You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<GlossaryTooltipterm="JSON web token (JWT)">JSON web tokens (JWT)</GlossaryTooltip> are often used as part of an authentication component on many web applications today. Since JWTs are crucial to identifying users and their access, ensuring the token’s integrity is important.
12
12
@@ -20,35 +20,72 @@ A JWT validation configuration consists of creating a token validation configura
20
20
21
21
### Add a token validation configuration
22
22
23
-
<Steps>
24
-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
25
-
2. Go to **Security** > **API Shield** > **Settings**.
26
-
3. Under **JSON Web Token Settings**, select **Add configuration**.
27
-
4. Add a name for your configuration.
28
-
5. Choose where Cloudflare can locate the JWT for this configuration on incoming requests, such as a header or cookie and its name.
29
-
6. Copy and paste your JWT issuer's public key(s) (JWKS).
30
-
</Steps>
23
+
<TabssyncKey="dashNewNav">
24
+
<TabItemlabel="Old dashboard">
25
+
<Steps>
26
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
27
+
2. Go to **Security** > **API Shield** > **Settings**.
28
+
3. Under **JSON Web Token Settings**, select **Add configuration**.
29
+
4. Add a name for your configuration.
30
+
5. Choose where Cloudflare can locate the JWT for this configuration on incoming requests, such as a header or cookie and its name.
31
+
6. Copy and paste your JWT issuer's public key(s) (JWKS).
32
+
</Steps>
33
+
</TabItem>
34
+
<TabItemlabel="New dashboard"icon="rocket">
35
+
<Steps>
36
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
37
+
2. Go to **Security** > **Settings**.
38
+
3. Filter by **API abuse**.
39
+
4. On **Token configurations**, select **Configure tokens**.
40
+
5. Add a name for your configuration.
41
+
6. Choose where Cloudflare can locate the JWT for this configuration on incoming requests, such as a header or cookie and its name.
42
+
7. Copy and paste your JWT issuer's public key(s) (JWKS).
43
+
</Steps>
44
+
</TabItem>
45
+
</Tabs>
31
46
32
47
Each JWT issuer typically publishes public keys (JWKS) for verification at a known URL on the Internet. If you do not know where to get them, contact your identity administrator.
33
48
34
49
To automatically keep your JWKS up to date when your identity provider refreshes them, you can use a Worker. Refer to [Configure Workers to automatically update keys](/api-shield/security/jwt-validation/jwt-worker/) to learn more about setting up the Worker.
35
50
36
51
### Add a JWT validation rule
37
52
38
-
<Steps>
39
-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
40
-
2. Go to **Security** > **API Shield** > **API Rules**.
41
-
3. <aid="rule-form"/>
42
-
Add a name for your rule.
43
-
4. Select a hostname to protect requests with saved endpoints using the rule.
44
-
5. Deselect any endpoints that you want JWT validation to ignore (for example, an endpoint used to generate a JWT).
45
-
6. Select the token validation configuration that corresponds to the incoming requests.
46
-
7. Choose whether to strictly enforce token presence on these endpoints.
47
-
- You may not expect 100% of clients to send in JWTs with their requests. If this is the case, choose *Ignore*. JWT validation will still validate JWTs that are present.
48
-
- You may otherwise expect all requests to the selected hostname and endpoints to contain JWTs. If this is the case, choose *Mark as non-compliant*.
49
-
8. Choose an action to take for non-compliant requests. For example, JWTs that do not pass validation (expired, tampered with, or bad signature tokens) or requests with missing JWTs when *Mark as non-compliant* is selected in the previous step.
50
-
9. Select **Save**.
51
-
</Steps>
53
+
54
+
<TabssyncKey="dashNewNav">
55
+
<TabItemlabel="Old dashboard">
56
+
<Steps>
57
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
58
+
2. Go to **Security** > **API Shield** > **API Rules**.
59
+
3. <aid="rule-form"/>
60
+
Add a name for your rule.
61
+
4. Select a hostname to protect requests with saved endpoints using the rule.
62
+
5. Deselect any endpoints that you want JWT validation to ignore (for example, an endpoint used to generate a JWT).
63
+
6. Select the token validation configuration that corresponds to the incoming requests.
64
+
7. Choose whether to strictly enforce token presence on these endpoints.
65
+
- You may not expect 100% of clients to send in JWTs with their requests. If this is the case, choose *Ignore*. JWT validation will still validate JWTs that are present.
66
+
- You may otherwise expect all requests to the selected hostname and endpoints to contain JWTs. If this is the case, choose *Mark as non-compliant*.
67
+
8. Choose an action to take for non-compliant requests. For example, JWTs that do not pass validation (expired, tampered with, or bad signature tokens) or requests with missing JWTs when *Mark as non-compliant* is selected in the previous step.
68
+
9. Select **Save**.
69
+
</Steps>
70
+
</TabItem>
71
+
<TabItemlabel="New dashboard"icon="rocket">
72
+
<Steps>
73
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account and domain.
74
+
2. Go to **Security** > **Security rules**.
75
+
3. On API JWT validation rules, select **Create rule**.
76
+
4. <aid="rule-form"/>
77
+
Add a name for your rule.
78
+
5. Select a hostname to protect requests with saved endpoints using the rule.
79
+
6. Deselect any endpoints that you want JWT validation to ignore (for example, an endpoint used to generate a JWT).
80
+
7. Select the token validation configuration that corresponds to the incoming requests.
81
+
8. Choose whether to strictly enforce token presence on these endpoints.
82
+
- You may not expect 100% of clients to send in JWTs with their requests. If this is the case, choose *Ignore*. JWT validation will still validate JWTs that are present.
83
+
- You may otherwise expect all requests to the selected hostname and endpoints to contain JWTs. If this is the case, choose *Mark as non-compliant*.
84
+
9. Choose an action to take for non-compliant requests. For example, JWTs that do not pass validation (expired, tampered with, or bad signature tokens) or requests with missing JWTs when *Mark as non-compliant* is selected in the previous step.
0 commit comments