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
Copy file name to clipboardExpand all lines: docs/authentication/enterprise-connections/saml/azure.mdx
+94-50Lines changed: 94 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -17,84 +17,128 @@ description: Learn how to allow users to sign up and sign in to your Clerk app w
17
17
}
18
18
]}
19
19
>
20
-
- Use Microsoft Azure Entra ID to enable SSO via SAML for your Clerk app
20
+
- Create a SSO connection via Clerk Dashboard
21
+
- Give your customer instructions on how to connect Microsoft Entra ID to your app
22
+
- Enable and test the SAML connection
21
23
</TutorialHero>
22
24
23
-
Enabling SAML with Microsoft Azure Entra ID (formerly [Active Directory](https://learn.microsoft.com/en-us/entra/fundamentals/new-name)) allows your users to sign up and sign in to your Clerk application with their Microsoft account.
25
+
Enabling SAML with Microsoft Entra ID (formerly [Azure Active Directory](https://learn.microsoft.com/en-us/entra/fundamentals/new-name)) allows your users to sign up and sign in to your Clerk application with their Microsoft account.
24
26
25
-
To make the setup process easier, it's recommended to keep two browser tabs open: one for the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) and one for your [Microsoft Azure portal](https://portal.azure.com).
27
+
This process requires configuration changes in both the Clerk Dashboard, and in your customer's Microsoft Entra ID settings in their Azure account.
26
28
27
29
<Steps>
28
-
## Enable Microsoft Entra ID as a SAML connection in Clerk
30
+
## Create a Microsoft Entra ID SAML connection in Clerk
29
31
30
32
1. In the Clerk Dashboard, navigate to the [**SSO connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page.
31
33
1. Select **Add connection** and select **For specific domains or organizations**.
32
34
1. Under **SAML**, select **Microsoft Entra ID (Formerly AD)**.
33
35
1. Enter the **Domain**. This is the email domain of the users you want to allow to sign in to your application. Optionally, select an **Organization**.
34
36
1. Enter the **Name**. This will be displayed on the sign-in form.
35
-
1. Select **Add connection**. You'll be redirected to the connection's configuration page.
36
-
1. In the **Service Provider Configuration** section, save the **Reply URL (Assertion Consumer Service URL)** and **Identifier (Entity ID)** values somewhere secure. Keep this page open.
37
+
1. Select **Add connection**. You'll be redirected to the connection's configuration page. Note that the connection is disabled by default.
38
+
1. In the **Service Provider Configuration** section, save the **Reply URL (Assertion Consumer Service URL)** and **Identifier (Entity ID)** values somewhere secure. You'll need to give these to the customer so they can configure their Microsoft Entra ID application.
37
39
38
-
## Create a new enterprise app in Microsoft
40
+
## Configure SAML application
39
41
40
-
1. In a separate page, navigate to the [Microsoft Azure portal](https://azure.microsoft.com/en-us/get-started/azure-portal) and sign in.
41
-
1. Under the **Azure Services** section, find and select **Enterprise applications**. You may have to go to the [**All services**](https://portal.azure.com/#allservices) page and then scroll down to the **Identity** section to find it.
42
-
1. Select **New application**. You'll be redirected to the **Browse Microsoft Entra Gallery** page.
43
-
1. Select **Create your own application**.
44
-
1. In the modal that opens:
42
+
Now that the enterprise connection is configured in Clerk and the **Reply URL** and **Identifier** are known, the customer's Microsoft application needs to be configured. At a high level, the process is:
45
43
46
-
- Enter the **Name** of your app.
47
-
- Select **Integrate any other application you don't find in the gallery (Non-gallery)**.
48
-
- Select **Create**.
44
+
- Create a new enterprise app in Microsoft Azure.
45
+
- Assign selected users or groups to that Microsoft application.
46
+
- Add the **Reply URL** and **Identifier** from Clerk to the Microsoft application's SAML configuration.
47
+
- Verify that the attribute mappings are correct.
48
+
- Obtain and share the application's metadata URL.
49
49
50
-
## Assign selected user or group in Microsoft
50
+
You are welcome the use the below email template with detailed instructions. They contain the following
51
+
template strings that you should replace with your actual values:
51
52
52
-
Now that you have created the enterprise app, you need to assign users or groups to the app. For example, if you were part of the Clerk organization, you would have access to users and groups within the Clerk organization. In this case, you could assign individual users or entire groups to the enterprise app you just created.
53
+
-\[YOUR\_APPLICATION\_NAME]
54
+
-\[YOUR\_CLERK\_ENTITY\_ID]
55
+
-\[YOUR\_CLERK\_REPLY\_URL]
53
56
54
-
1. In the **Getting Started** section, select the **Assign users and groups** link.
55
-
1. Select **Add user/group**. You'll be redirected to the **Add Assignment** page.
56
-
1. Select the **None Selected** link.
57
-
1. To assign a user to the enterprise app, you can either use the search field to find a user or select the checkbox next to the user in the table.
58
-
1. Select **Select** at the bottom of the page. You'll be redirected to the **Add Assignment** page.
59
-
1. Select **Assign** at the bottom of the page.
57
+
<Copyableas="html">
58
+
Here are the instructions for setting up SAML SSO with Microsoft Entra ID:
60
59
61
-
## Configure Clerk as your Service Provider
60
+
**Step 1: Create a new enterprise application in Microsoft**
62
61
63
-
After assigning the user or group to the enterprise app, you need to configure the SSO settings in Microsoft to enable SAML SSO.
62
+
1. Navigate to the [Microsoft Azure portal](https://azure.microsoft.com/en-us/get-started/azure-portal) and sign in.
63
+
1. Under the **Azure Services** section, find and select **Enterprise applications**. You may have to go to the [**All services**](https://portal.azure.com/#allservices) page and then scroll down to the **Identity** section to find it.
64
+
1. Select **New application**. You'll be redirected to the **Browse Microsoft Entra Gallery** page.
65
+
1. Select **Create your own application**.
66
+
1. In the modal that opens:
67
+
-**Name** of your application (likely \[YOUR\_APPLICATION\_NAME]).
68
+
- Select **Integrate any other application you don't find in the gallery (Non-gallery)**.
69
+
- Select **Create**.
64
70
65
-
1. In the navigation sidenav, open the **Manage** dropdown and select **Single sign-on**.
66
-
1. In the **Select a single sign-on method** section, select **SAML**. You'll be redirected to the **Set up Single Sign-On with SAML** page.
67
-
1. Find the **Basic SAML Configuration** section.
68
-
1. Select **Edit**. The **Basic SAML Configuration** panel will open.
69
-
1. Paste the **Identifier (Entity ID)** and **Reply URL (Assertion Consumer Service URL)** values you saved from the Clerk Dashboard into their respective fields. These values will be saved automatically.
70
-
1. Select **Save** at the top of the panel. Close the panel.
71
+
**Step 2: Assign your users or groups in Microsoft**
71
72
72
-
## Configure Microsoft as your Identity Provider
73
+
Now that you have created the enterprise app, you need to assign users or groups before they can use it to log in. Below are instructions for assigning an individual user, but for more options and instructions for groups, see Microsoft's docs [here](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/assign-user-or-group-access-portal?pivots=portal).
73
74
74
-
1. On the **Set up Single Sign-On with SAML** page, find the **SAML Certificates** section.
75
-
1. Copy the **App Federation Metadata Url**.
76
-
1. Navigate back to the **Clerk Dashboard**. In the **Identity Provider Configuration** section, under **App Federation Metadata Url**, paste the **App Federation Metadata URL**.
77
-
1. Select **Fetch & save**.
75
+
1. In the **Getting Started** section, select the **Assign users and groups** link.
76
+
1. Select **Add user/group**. You'll be redirected to the **Add Assignment** page.
77
+
1. Select the **None Selected** link.
78
+
1. To assign a user to the enterprise app, you can either use the search field to find a user or select the checkbox next to the user in the table.
79
+
1. Select **Select** at the bottom of the page. You'll be redirected to the **Add Assignment** page.
80
+
1. Select **Assign** at the bottom of the page.
78
81
79
-
## Map Microsoft claims to Clerk attributes
82
+
**Step 3: Set Basic SAML Configuration**
80
83
81
-
Mapping the claims in your IdP to the attributes in Clerk ensures that the data from your IdP is correctly mapped to the data in Clerk.
84
+
1. In the navigation sidenav, open the **Manage** dropdown and select **Single sign-on**.
85
+
1. In the **Select a single sign-on method** section, select **SAML**. You'll be redirected to the **Set up Single Sign-On with SAML** page.
86
+
1. Find the **Basic SAML Configuration** section.
87
+
1. Select **Edit**. The **Basic SAML Configuration** panel will open.
88
+
1. Add the following **Identifier (Entity ID)** and **Reply URL (Assertion Consumer Service URL)** values. These values will be saved automatically.
-**Reply URL (Assertion Consumer Service URL)**: `[YOUR_CLERK_REPLY_URL]`
91
+
1. Select **Save** at the top of the panel. Close the panel.
82
92
83
-
| Clerk attribute | Microsoft claim |
84
-
| - | - |
85
-
|`mail`|`user.userprincipalname`|
86
-
|`firstName`|`user.givenname`|
87
-
|`lastName`|`user.surname`|
93
+
**Step 4: Verify correct configuration of attributes and claims**
88
94
89
-
The only Microsoft claim that is necessary to map is the email address claim. This is the email address that your users will use to authenticate into your app.
95
+
We expect your SAML responses to have the following specific attributes:
90
96
91
-
1. On the **Set up Single Sign-On with SAML** page, find the **Attributes & Claims** section.
92
-
1. Select **Edit**.
93
-
1. To edit the email claim, select the claim with the claim name ending with `/claims/emailaddress`. You'll be redirected to the **Manage claim** page.
94
-
1. Next to **Source attribute**, search for and select `user.userprincipalname` in the dropdown.
95
-
1. Select **Save** at the top of the page.
97
+
Email address (required). This is the email address that your users will use to authenticate into your app:
These are the defaults, and probably won't need you to change them. However, many SAML configuration errors are due to incorrect attribute mappings, so it's worth double-checking. Here's how:
113
+
114
+
1. Still on the **Set up Single Sign-On with SAML** page, find the **Attributes & Claims** section.
115
+
1. Select **Edit**.
116
+
1. Verify that the above three attributes and values are present.
117
+
118
+
**Step 5: Share the application's metadata URL**
119
+
120
+
1. Still on the **Set up Single Sign-On with SAML** page, find the **SAML Certificates** section.
121
+
1. Copy the **App Federation Metadata Url**, and reply to this email with it. This is the final piece of information we need to enable SAML.
122
+
</Copyable>
123
+
124
+
## Add App Federation Metadata URL in the Clerk Dashboard
125
+
126
+
After following the instructions in the email, your customer should have sent you the Microsoft app's **App Federation Metadata URL**. Now, you're going to add it to the Clerk connection, completing the SAML connection configuration.
127
+
128
+
1. Navigate to the [**SSO connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page in the Clerk Dashboard.
129
+
1. Select the SAML connection.
130
+
1. In the **Identity Provider Configuration** section, under **App Federation Metadata Url**, paste the **App Federation Metadata URL**.
131
+
1. Select **Fetch & save**. Keep the page open for the next step.
The SAML connection is ready to enable! Once enabled, all users with email addresses ending in the domain will be redirected to Microsoft at sign-up and sign-in.
136
+
137
+
> [!WARNING]
138
+
> If there are existing users with email domains that match the SAML connection, and there is an error in the SAML configuration in Clerk or Microsoft, those users will be **unable to sign in** when the connection is enabled. If this is a concern, we recommend coordinating with your counterpart to test the connection at an off-peak time.
139
+
140
+
To make the connection available for users to authenticate with:
141
+
142
+
1. Navigate back to the Clerk Dashboard where you should still have the connection's configuration page open. If not, navigate to the [**SSO connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page and select the connection.
143
+
1. At the top of the page, toggle on **Enable connection** and select **Save**.
0 commit comments