Skip to content

Commit 494bb2e

Browse files
committed
Replace key authorization with tokens
1 parent 2667199 commit 494bb2e

File tree

9 files changed

+18
-35
lines changed

9 files changed

+18
-35
lines changed

src/content/docs/cloudflare-one/applications/configure-apps/dash-sso-apps.mdx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ If there is an issue with your SSO IdP provider, you can add an alternate IdP us
7272

7373
```bash title="cURL command"
7474
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers' \
75-
--header "X-Auth-Email: <EMAIL>" \
76-
--header "X-Auth-Key: <API_KEY>" \
75+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
7776
--header "Content-Type: application/json" \
7877
--data '{
7978
"type": "onetimepin",
@@ -85,8 +84,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_
8584

8685
```bash title="cURL command"
8786
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
88-
--header "X-Auth-Email: <EMAIL>" \
89-
--header "X-Auth-Key: <API_KEY>" \
87+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
9088
| jq '.result[] | select(.type == "dash_sso")'
9189
```
9290

@@ -105,8 +103,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
105103
```bash title="cURL command"
106104
curl --request PUT \
107105
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
108-
--header "X-Auth-Email: <EMAIL>" \
109-
--header "X-Auth-Key: <API_KEY>" \
106+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
110107
--header "Content-Type: application/json" \
111108
--data '{
112109
"id": "3537a672-e4d8-4d89-aab9-26cb622918a1",
@@ -126,8 +123,7 @@ The following API calls will disable SSO enforcement for an account. This action
126123

127124
```bash title="cURL command"
128125
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors \
129-
--header "X-Auth-Email: <EMAIL>" \
130-
--header "X-Auth-Key: <API_KEY>"
126+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
131127
```
132128

133129
```json title="Response"
@@ -152,8 +148,7 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors
152148
```bash title="cURL command"
153149
curl --request PATCH \
154150
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors/2828' \
155-
--header "X-Auth-Email: <EMAIL>" \
156-
--header "X-Auth-Key: <API_KEY>" \
151+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
157152
--header "Content-Type: application/json" \
158153
--data '{
159154
"sso_connector_status": "DIS"

src/content/docs/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ Currently, authentication tokens can only be generated through the API. You can
115115

116116
```bash
117117
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/service_tokens" \
118-
--header "X-Auth-Email: <EMAIL>" \
119-
--header "X-Auth-Key: <API_KEY>" \
118+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
120119
--header "Content-Type: application/json" \
121120
--data '{"name":"ACME Corporation service token"}'
122121
```
@@ -149,8 +148,7 @@ Save the service token's `client_id`, `client_secret`, and `id`.
149148
```bash
150149
curl --request PUT \
151150
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/organizations/doh/$SERVICE_TOKEN_ID" \
152-
--header "X-Auth-Email: <EMAIL>" \
153-
--header "X-Auth-Key: <API_KEY>"
151+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
154152
```
155153

156154
If you get an `access.api.error.service_token_not_found` error, check that `$SERVICE_TOKEN_ID` is the value of `id` and not `client_id`.
@@ -182,8 +180,7 @@ Create a new user and optionally add them to a group.
182180

183181
```bash
184182
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/users" \
185-
--header "X-Auth-Email: <EMAIL>" \
186-
--header "X-Auth-Key: <API_KEY>" \
183+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
187184
--header "Content-Type: application/json" \
188185
--data '{
189186
"name": "John Doe",

src/content/docs/cloudflare-one/connections/connect-devices/warp/configure-warp/device-profiles.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ Send a `POST` request to the [Devices endpoint](/api/resources/zero_trust/subres
3636

3737
```bash
3838
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/devices/policy \
39-
--header "X-Auth-Email: <EMAIL>" \
40-
--header "X-Auth-Key: <API_KEY>" \
39+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
4140
--header "Content-Type: application/json" \
4241
--data '{
4342
"allow_mode_switch": false,

src/content/docs/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-modes/device-information-only.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ pcx_content_type: how-to
33
title: Enable Device Information Only
44
sidebar:
55
order: 2
6-
76
---
87

9-
import { TabItem, Tabs } from "~/components"
8+
import { TabItem, Tabs } from "~/components";
109

1110
Device Information Only mode allows you to enforce device posture rules when a user connects to your [self-hosted Access application](/cloudflare-one/applications/configure-apps/self-hosted-public-app/). This mode relies on a client certificate generated from your account to establish trust between the Access application and the device.
1211

@@ -17,8 +16,7 @@ To set up Device Information Only mode:
1716
```bash
1817
curl --request PATCH \
1918
"https://api.cloudflare.com/client/v4/zones/{zone_id}/devices/policy/certificates" \
20-
--header "X-Auth-Email: <EMAIL>" \
21-
--header "X-Auth-Key: <API_KEY>" \
19+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
2220
--header "Content-Type: application/json" \
2321
--data '{"enabled": true}'
2422
```
@@ -68,7 +66,7 @@ The certificate name should match the **Device ID** in your WARP client **Prefer
6866
4. Change the **URI path** field to **Hostname**, and enter the domain you want to protect.
6967
5. Select **Deploy**. This creates a WAF custom rule that checks all requests to your domain for a valid client certificate.
7068

71-
Device Information Only mode is now enabled on the device. To start enforcing device posture, set up a [WARP client check](/cloudflare-one/identity/devices/warp-client-checks/) and add a *Require* device posture rule to your [Access policy](/cloudflare-one/policies/access/). When the device connects to the Access application for the first time, the browser will ask to use the client certificate installed by WARP.
69+
Device Information Only mode is now enabled on the device. To start enforcing device posture, set up a [WARP client check](/cloudflare-one/identity/devices/warp-client-checks/) and add a _Require_ device posture rule to your [Access policy](/cloudflare-one/policies/access/). When the device connects to the Access application for the first time, the browser will ask to use the client certificate installed by WARP.
7270

7371
<div class="large-img">
7472

src/content/docs/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ To delete the SSH encryption public key using the [API](/api/resources/zero_trus
119119

120120
```sh
121121
curl --request PUT https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/audit_ssh_settings \
122-
--header "X-Auth-Email: <EMAIL>" \
123-
--header "X-Auth-Key: <API_KEY>" \
122+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
124123
--data '{
125124
"public_key": ""
126125
}'

src/content/docs/cloudflare-one/insights/logs/audit-logs.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ The [Access authentication logs](/api/resources/zero_trust/subresources/access/s
4444

4545
```bash title="Request"
4646
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/logs/access_requests?limit=25&direction=desc&since=2020-07-01T05:20:00Z&until=2020-10-01T05:20:00Z" \
47-
--header "X-Auth-Email: <EMAIL>" \
48-
--header "X-Auth-Key: <API_KEY>"
47+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
4948
```
5049

5150
```json title="Response"

src/content/docs/cloudflare-one/policies/gateway/dns-policies/timed-policies.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ The following command creates a DNS policy to block `facebook.com` only on weekd
5151

5252
```bash
5353
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rules" \
54-
--header "X-Auth-Email: <EMAIL>" \
55-
--header "X-Auth-Key: <API_KEY>" \
54+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
5655
--header "Content-Type: application/json" \
5756
--data '{
5857
"name": "office-no-facebook-policy",
@@ -78,8 +77,7 @@ The following command creates a DNS policy to block `clockin.com` only on weeken
7877

7978
```bash
8079
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rules" \
81-
--header "X-Auth-Email: <EMAIL>" \
82-
--header "X-Auth-Key: <API_KEY>" \
80+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
8381
--header "Content-Type: application/json" \
8482
--data '{
8583
"name": "clock-in-policy",

src/content/partials/cloudflare-one/access/rule-group.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ Send a `POST` request to the [`/access/groups`](/api/resources/zero_trust/subres
2828

2929
```bash
3030
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/groups \
31-
--header "X-Auth-Email: <EMAIL>" \
32-
--header "X-Auth-Key: <API_KEY>" \
31+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
3332
--header "Content-Type: application/json" \
3433
--data '{
3534
"name": "Lisbon-team",

src/content/partials/cloudflare-one/gateway/lists.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ You can now use this list in the policy builder by choosing the _in list_ operat
4949

5050
```bash
5151
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/lists \
52-
--header "X-Auth-Email: <EMAIL>" \
53-
--header "X-Auth-Key: <API_KEY>" \
52+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
5453
--header "Content-Type: application/json" \
5554
--data '{
5655
"description": "Private application IPs",

0 commit comments

Comments
 (0)