Skip to content

Commit 6d4465f

Browse files
committed
Replace API keys with token auth
1 parent 649f3d0 commit 6d4465f

File tree

7 files changed

+14
-28
lines changed

7 files changed

+14
-28
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
@@ -74,8 +74,7 @@ If there is an issue with your SSO IdP provider, you can add an alternate IdP us
7474

7575
```bash title="cURL command"
7676
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers' \
77-
--header "X-Auth-Email: <EMAIL>" \
78-
--header "X-Auth-Key: <API_KEY>" \
77+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
7978
--header "Content-Type: application/json" \
8079
--data '{
8180
"type": "onetimepin",
@@ -87,8 +86,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_
8786

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

@@ -107,8 +105,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
107105
```bash title="cURL command"
108106
curl --request PUT \
109107
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
110-
--header "X-Auth-Email: <EMAIL>" \
111-
--header "X-Auth-Key: <API_KEY>" \
108+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
112109
--header "Content-Type: application/json" \
113110
--data '{
114111
"id": "3537a672-e4d8-4d89-aab9-26cb622918a1",
@@ -128,8 +125,7 @@ The following API calls will disable SSO enforcement for an account. This action
128125

129126
```bash title="cURL command"
130127
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors \
131-
--header "X-Auth-Email: <EMAIL>" \
132-
--header "X-Auth-Key: <API_KEY>"
128+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
133129
```
134130

135131
```json title="Response"
@@ -154,8 +150,7 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors
154150
```bash title="cURL command"
155151
curl --request PATCH \
156152
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors/2828' \
157-
--header "X-Auth-Email: <EMAIL>" \
158-
--header "X-Auth-Key: <API_KEY>" \
153+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
159154
--header "Content-Type: application/json" \
160155
--data '{
161156
"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-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",

0 commit comments

Comments
 (0)