Skip to content

Commit b946c59

Browse files
[ZT] SSO apps (#25412)
--------- Co-authored-by: marciocloudflare <[email protected]>
1 parent 83c8e8a commit b946c59

File tree

2 files changed

+193
-131
lines changed

2 files changed

+193
-131
lines changed

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

Lines changed: 186 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,100 @@ sidebar:
99

1010
import { FeatureTable, APIRequest, GlossaryTooltip } from "~/components";
1111

12-
By adding a Cloudflare Dashboard SSO application to your Cloudflare Zero Trust account, you can enforce single sign-on (SSO) to the Cloudflare dashboard with the identity provider (IdP) of your choice. SSO will be enforced for every user in your email domain.
12+
Cloudflare offers single sign-on (SSO) for all customers who log in with a custom email domain. By creating a Cloudflare SSO connector, you can enforce SSO to the Cloudflare dashboard with the identity provider (IdP) of your choice. SSO will be enforced for every user in your email domain.
1313

1414
## Availability
1515

16+
Cloudflare Dashboard SSO is available for free to all plans.
17+
1618
<FeatureTable id="account.single_sign_on" />
1719

1820
## Prerequisites
1921

20-
All users in your email domain must exist as a member in your Cloudflare account and IdP. To add users to your Cloudflare account, refer to [Manage Cloudflare account access](/fundamentals/manage-members/).
22+
1. You must control your email domain and be able to add a TXT record to verify this.
23+
- Public email providers such as `@gmail.com` are not allowed.
24+
- Every user with that email domain must be an employee in your organization. For example, university domains such as `@harvard.edu` are not allowed because they include student emails.
25+
26+
2. You must be a super administrator and be able to access the Cloudflare API.
27+
28+
3. A Cloudflare Zero Trust organization with any subscription tier (including Free) must be created. To set up a Cloudflare Zero Trust organization, refer to [Create a Cloudflare Zero Trust organization](/cloudflare-one/setup/#create-a-zero-trust-organization).
2129

2230
## 1. Set up an IdP
2331

2432
Add an IdP to Cloudflare Zero Trust by following [our detailed instructions](/cloudflare-one/identity/idp-integration/).
2533

2634
Once you configure your IdP, make sure you also [test your IdP](/cloudflare-one/identity/idp-integration/#test-idps-in-zero-trust).
2735

28-
## 2. Contact your account team
36+
## 2. Register your domain with Cloudflare for SSO
37+
38+
:::caution
39+
Cloudflare recommends creating an [Account API token](/fundamentals/api/get-started/create-token/) with the role `SSO Connector Edit` and storing it securely. This acts as a backup plan, allowing you to disable SSO via the API if you are accidentally locked out, such as due to changes in your IdP configuration later.
40+
:::
2941

30-
Ask your account team to approve and create your SSO domain. An SSO domain is the email domain associated with the members in your Cloudflare account. For example, if your SSO domain is configured for emails ending in `@yourcompany.com`, a member with email `@test.com` would not see the **Log in with SSO** option and would have to enter their username and password.
42+
Using a command line terminal where you have already set the environment variable `CLOUDFLARE_API_TOKEN` to a user or account API token which has the `SSO Connector Edit` permission, run the following command to create an SSO connector. Replace `{account_id}` with your account ID, and `{domain}` with your email domain.
3143

32-
Once your SSO domain is approved, a new **SSO App** application will appear under **Access** > **Applications**. The application is pre-configured with `allow email domain` as the default rule and your IdP as the authentication providers.
44+
```bash title="cURL command"
45+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors" \
46+
--request POST \
47+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
48+
--json '{"email_domain":"{domain}"}'
49+
```
3350

34-
### SSO domain requirements
51+
```json output
52+
{
53+
"success": true,
54+
"errors": [],
55+
"messages": [],
56+
"result": {
57+
"id": "c3ebcba5c20b42f73e111110d0be67d",
58+
"enabled": false,
59+
"email_domain": "cool.cats",
60+
"verification": {
61+
"code": "cloudflare_dashboard_sso=111111111",
62+
"status": "pending"
63+
},
64+
"created_on": "2025-09-05T20:35:34Z"
65+
}
66+
}
67+
```
3568

36-
- The email domain must belong to your organization. Public email providers such as `@gmail.com` are not allowed.
37-
- Every user with that email domain must be an employee in your organization. For example, university domains such as `@harvard.edu` are not allowed because they include student emails.
38-
- Your SSO domain can include multiple email domains.
69+
## 3. Verify domain ownership
3970

40-
:::caution
71+
Copy the verification code (for example `cloudflare_dashboard_sso=1111111`) and create a TXT record in your DNS configuration with that value. Cloudflare will automatically poll that DNS record until it is found or a timeout is reached within two days.
4172

42-
Enabling Cloudflare Dashboard SSO for an email domain (for example, `@mycompany.com`) will apply globally across all Cloudflare accounts where users log in with that domain. All users will be required to authenticate via the specified identity provider (IdP), including users on pre-existing Cloudflare accounts.
73+
If verification fails due to timeout, you may manually reinitiate the polling by running the following command:
4374

44-
:::
75+
```bash title="cURL command"
76+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors/{sso_connector_id}/begin_verification" \
77+
--request POST \
78+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
79+
```
4580

46-
## 3. Enable dashboard SSO
81+
Once the verification polling has completed or timed out, you will receive an email notification with the verification result.
4782

48-
:::note
83+
## 4. Enable dashboard SSO
4984

50-
Cloudflare recommends carefully storing your [Global API key](/fundamentals/api/get-started/keys/) to access when necessary. You will need your Global API key when you [disable SSO](#option-2-disable-dashboard-sso).
85+
:::caution
86+
Enabling Cloudflare Dashboard SSO for an email domain (for example, `@mycompany.com`) will apply globally to all users with that domain, regardless of which accounts those users have access to. All users will be required to authenticate via the specified identity provider, including users registered on Cloudflare prior to the domain being configured for SSO.
5187
:::
5288

53-
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Settings** > **Authentication**.
54-
2. In the **Cloudflare dashboard SSO** card, set your email domain to **Enabled**. This action can only be performed by Super Administrators.
55-
3. Do not log out or close your browser window. Instead, open a different browser or an incognito window.
56-
4. In the [Cloudflare dashboard](https://dash.cloudflare.com), log in with your email address from your SSO domain.
57-
5. If you can log in successfully, you have successfully set up your dashboard SSO application.
58-
6. If you cannot log in successfully:
89+
Enable the connector by running the following — again, replacing the `{account_id}` value with your account ID, and additionally replacing the `{sso_connector_id}` with the value you obtained from the `id` field in the response to the previous call.
5990

60-
1. Return to Zero Trust and go to **Settings** > **Authentication**.
61-
2. For **Cloudflare dashboard SSO**, set your email domain to **Disabled**.
62-
3. [Re-configure your IdP](/cloudflare-one/identity/idp-integration/).
91+
```bash title="cURL command"
92+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors/{sso_connector_id}" \
93+
--request PATCH \
94+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
95+
--json '{"enabled": true}'
96+
```
6397

6498
## Limitations
6599

66100
Cloudflare dashboard SSO does not support:
67101

68102
- Users with plus-addressed emails, such as `[email protected]`. If you have users like this added to your Cloudflare organization, they will be unable to login with SSO.
69-
- Adding a separate email-based policy to the SSO application that does not match your SSO domain policy. As your account team must [approve and create your SSO domain](/cloudflare-one/applications/configure-apps/dash-sso-apps/#2-contact-your-account-team) based on the [SSO domain requirements](/cloudflare-one/applications/configure-apps/dash-sso-apps/#sso-domain-requirements), adding a new domain policy on your own will not work.
70-
- Deleting the auto-generated `allow email domain` policy. If this policy was deleted, your organization's administrators would not be able to access the Cloudflare dashboard.
103+
- Adding a separate email-based policy to the SSO application that does not match your SSO domain policy.
104+
- Multiple domain policies. If another domain policy is required, you can create another SSO connector. This will create a second policy for that new domain in your SSO application.
105+
- Deleting the auto-generated `allow email domain` policy. If this policy is deleted, your organization's administrators cannot access the Cloudflare dashboard.
71106

72107
## IdP-initiated SSO
73108

@@ -88,7 +123,7 @@ Configure an identity provider (IdP)-initiated single sign-on (SSO) session usin
88123
#### Configure Okta as the IdP
89124

90125
1. Log in to your [Okta Admin Dashboard](https://login.okta.com/) and go to **Applications** > **Applications**.
91-
2. Select **Create App Integration** to start a new SAML integration to handle the IdP-initated SSO flow.
126+
2. Select **Create App Integration** to start a new SAML integration to handle the IdP-initiated SSO flow.
92127
3. In the pop-up, select **SAML 2.0** and select **Next**.
93128
4. Enter a name for the app and select **Next**.
94129
5. In the **Single Sign-On URL** field, paste the **SSO Endpoint URL** [you copied earlier](/cloudflare-one/applications/configure-apps/dash-sso-apps/#prerequisites-1).
@@ -117,123 +152,151 @@ If there is an issue with your SSO IdP provider, you can add an alternate IdP us
117152

118153
1. [Add](/api/resources/zero_trust/subresources/identity_providers/methods/create/) one-time PIN login:
119154

120-
<APIRequest
121-
path="/accounts/{account_id}/access/identity_providers"
122-
method="POST"
123-
json={{
124-
type: "onetimepin",
125-
config: {},
126-
}}
127-
/>
155+
<APIRequest
156+
path="/accounts/{account_id}/access/identity_providers"
157+
method="POST"
158+
json={{
159+
type: "onetimepin",
160+
config: {},
161+
}}
162+
/>
128163

129164
2. [Get](/api/resources/zero_trust/subresources/access/subresources/applications/methods/list/) the `id` of the `dash_sso` Access application. You can use [`jq`](https://jqlang.github.io/jq/download/) to quickly find the correct application:
130165

131-
```bash title="cURL command"
132-
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
133-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
134-
| jq '.result[] | select(.type == "dash_sso")'
135-
```
136-
137-
```json title="Response"
138-
{
139-
"id": "3537a672-e4d8-4d89-aab9-26cb622918a1",
140-
"uid": "3537a672-e4d8-4d89-aab9-26cb622918a1",
141-
"type": "dash_sso",
142-
"name": "SSO App"
143-
...
144-
}
145-
```
166+
```bash title="cURL command"
167+
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps" \
168+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
169+
| jq '.result[] | select(.type == "dash_sso")'
170+
```
171+
172+
```json output {2}
173+
{
174+
"id": "3537a672-e4d8-4d89-aab9-26cb622918a1",
175+
"uid": "3537a672-e4d8-4d89-aab9-26cb622918a1",
176+
"type": "dash_sso",
177+
"name": "SSO App"
178+
// ...
179+
}
180+
```
146181

147182
3. Using the `id` obtained above, [update](/api/resources/zero_trust/subresources/access/subresources/applications/methods/update/) **SSO App** to accept all identity providers. To avoid overwriting your existing configuration, the PUT request body should contain all fields returned by the previous GET request.
148183

149-
<APIRequest
150-
path="/accounts/{account_id}/access/apps/{app_id}"
151-
method="PUT"
152-
parameters={{ app_id: "3537a672-e4d8-4d89-aab9-26cb622918a1" }}
153-
json={{
154-
id: "3537a672-e4d8-4d89-aab9-26cb622918a1",
155-
uid: "3537a672-e4d8-4d89-aab9-26cb622918a1",
156-
type: "dash_sso",
157-
name: "SSO App",
158-
allowed_idps: [],
159-
// ... (other existing properties)
160-
}}
161-
code={{
162-
mark: [9]
163-
}}
164-
/>
184+
<APIRequest
185+
path="/accounts/{account_id}/access/apps/{app_id}"
186+
method="PUT"
187+
parameters={{ app_id: "3537a672-e4d8-4d89-aab9-26cb622918a1" }}
188+
json={{
189+
id: "3537a672-e4d8-4d89-aab9-26cb622918a1",
190+
uid: "3537a672-e4d8-4d89-aab9-26cb622918a1",
191+
type: "dash_sso",
192+
name: "SSO App",
193+
allowed_idps: [],
194+
// ... (other existing properties)
195+
}}
196+
code={{
197+
mark: [9],
198+
}}
199+
/>
165200

166201
Users will now have the option to log in using a one-time PIN.
167202

168203
### Option 2: Disable dashboard SSO
169204

170205
The following API calls will disable SSO enforcement for an account. This action can only be performed by Super Administrators.
171206

172-
1. Get your SSO `connector_id`:
173-
174-
```bash title="cURL command"
175-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors \
176-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
177-
```
178-
179-
```json title="Response"
180-
{
181-
"result": [
182-
{
183-
"connector_id": "2828",
184-
"connector_tag": "d616ac82cc7f87153112d75a711c5c3c",
185-
"email_domain": "yourdomain.com",
186-
"connector_status": "V",
187-
...
188-
}
189-
],
190-
"success": true,
191-
"errors": [],
192-
"messages": []
193-
}
194-
```
207+
1. Get your SSO connector `id`:
208+
209+
```bash title="cURL command"
210+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors" \
211+
--request GET \
212+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
213+
```
214+
215+
```json output
216+
{
217+
"result": [
218+
{
219+
"id": "d616ac82cc7f87153112d75a711c5c3c",
220+
"email_domain": "cool.cats",
221+
"enabled": true
222+
// ...
223+
}
224+
],
225+
"success": true,
226+
"errors": [],
227+
"messages": []
228+
}
229+
```
195230

196231
2. Disable the SSO connector:
197232

198-
```bash title="cURL command"
199-
curl --request PATCH \
200-
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors/2828' \
201-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
202-
--header "Content-Type: application/json" \
203-
--data '{
204-
"sso_connector_status": "DIS"
205-
}'
206-
```
207-
208-
```json title="Response"
209-
{
210-
"result": {
211-
"id": "2828"
212-
},
213-
"success": true,
214-
"errors": [],
215-
"messages": []
216-
}
217-
```
218-
219-
Users can now log in using their Cloudflare account email and password. To re-enable SSO, send a `PATCH` request with `"sso_connector_status" : "V"`.
233+
```bash title="cURL command"
234+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors/{connector_id}" \
235+
--request PATCH \
236+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
237+
--json '{
238+
"enabled": false
239+
}'
240+
```
241+
242+
```json output
243+
{
244+
"result": [
245+
{
246+
"id": "d616ac82cc7f87153112d75a711c5c3c",
247+
"email_domain": "cool.cats",
248+
"enabled": false
249+
// ...
250+
}
251+
],
252+
"success": true,
253+
"errors": [],
254+
"messages": []
255+
}
256+
```
257+
258+
Users can now log in using their Cloudflare account email and password. If a user does not have a password, they can use the [forgot password](/fundamentals/user-profiles/change-password-or-email/#forgot-your-password) method on the login page to create one.
220259

221260
## Change your team name
222261

223-
Cloudflare does not allow you to change your <GlossaryTooltip term="team name">team name</GlossaryTooltip> while dashboard SSO is enabled. To change your team name, you must disable dashboard SSO and reach out to your account team.
262+
Cloudflare does not allow you to change your <GlossaryTooltip term="team name">team name</GlossaryTooltip> while a SSO connector is created. To change your team name, you must disable and delete your SSO connector(s).
224263

225264
:::caution
226-
Before disabling SSO, make sure you have access to your Cloudflare account email. This will allow you to reset your password in case you get logged out of the Cloudflare dashboard.
265+
Before disabling SSO, make sure you have access to your Cloudflare user email. This will allow you to reset your password in case you get logged out of the Cloudflare dashboard.
227266
:::
228267

229268
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Settings** > **Authentication**.
230-
2. If SSO is enabled, turn off **Cloudflare dashboard SSO**. This action can only be performed by Super Administrators.
231-
3. Ask your account team to delete your **SSO App** from **Access** > **Applications**. The SSO app cannot be deleted using the Zero Trust dashboard or API.
232-
4. Go to **Settings** > **Custom Pages**.
233-
5. Under **Team domain**, select **Edit** to enter the new team name. Select **Save**.
234-
6. In your identity provider, update your Cloudflare integration with the new team name. For example, if you are using a SAML IdP, you will need to update the Single Sign-on URL and Entity ID to `https://<new-team-name>.cloudflareaccess.com/cdn-cgi/access/callback`.
235-
7. Ask your account team to reactivate your SSO domain. Once your SSO domain is reactivated, a new **SSO App** application will appear in Zero Trust under **Access** > **Applications**.
236-
8. In Zero Trust, go to **Settings** > **Authentication**.
237-
9. Turn on **Cloudflare dashboard SSO** to re-enable SSO.
238-
239-
269+
2. Turn off **Cloudflare dashboard SSO** for any enabled domains. This action can only be performed by Super Administrators.
270+
271+
3. Get all SSO connectors for your account.
272+
273+
```bash title="cURL command"
274+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors" \
275+
--request GET \
276+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
277+
```
278+
279+
4. Disable any active SSO connectors using the `id` of each connector from the previous step.
280+
281+
```bash title="cURL command"
282+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors/{connector_id}" \
283+
--request PATCH \
284+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
285+
--json '{
286+
"enabled": false
287+
}'
288+
```
289+
290+
5. Delete all SSO connectors using the `id` of each connector from the previous step.
291+
292+
```bash title="cURL command"
293+
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/sso_connectors/{connector_id}" \
294+
--request DELETE \
295+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
296+
```
297+
298+
6. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Settings** > **Custom Pages**.
299+
7. Under **Team domain**, select **Edit** to enter the new team name. Select **Save**.
300+
8. In your identity provider, update your Cloudflare integration with the new team name. For example, if you are using a SAML IdP, you will need to update the Single Sign-on URL and Entity ID to `https://<new-team-name>.cloudflareaccess.com/cdn-cgi/access/callback`.
301+
9. Recreate any deleted SSO connectors using the steps in [Register your domain with Cloudflare for SSO](/cloudflare-one/applications/configure-apps/dash-sso-apps/#2-register-your-domain-with-cloudflare-for-sso).
302+
10. Follow the verification and enable steps after recreating the SSO connectors.

0 commit comments

Comments
 (0)