Skip to content

Commit 71bfc1a

Browse files
izaaklauerLauraBeatrisalexisintech
committed
Rewrite Azure SAML docs for application owners (#2112)
Co-authored-by: Laura Beatris <[email protected]> Co-authored-by: Alexis Aguilar <[email protected]>
1 parent 43d6138 commit 71bfc1a

File tree

1 file changed

+94
-50
lines changed
  • docs/authentication/enterprise-connections/saml

1 file changed

+94
-50
lines changed

docs/authentication/enterprise-connections/saml/azure.mdx

Lines changed: 94 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,84 +17,128 @@ description: Learn how to allow users to sign up and sign in to your Clerk app w
1717
}
1818
]}
1919
>
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
2123
</TutorialHero>
2224

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.
2426

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.
2628

2729
<Steps>
28-
## Enable Microsoft Entra ID as a SAML connection in Clerk
30+
## Create a Microsoft Entra ID SAML connection in Clerk
2931

3032
1. In the Clerk Dashboard, navigate to the [**SSO connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page.
3133
1. Select **Add connection** and select **For specific domains or organizations**.
3234
1. Under **SAML**, select **Microsoft Entra ID (Formerly AD)**.
3335
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**.
3436
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.
3739

38-
## Create a new enterprise app in Microsoft
40+
## Configure SAML application
3941

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:
4543

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.
4949

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:
5152

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]
5356

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+
<Copyable as="html">
58+
Here are the instructions for setting up SAML SSO with Microsoft Entra ID:
6059

61-
## Configure Clerk as your Service Provider
60+
**Step 1: Create a new enterprise application in Microsoft**
6261

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**.
6470

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**
7172

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).
7374

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.
7881

79-
## Map Microsoft claims to Clerk attributes
82+
**Step 3: Set Basic SAML Configuration**
8083

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.
89+
- **Identifier (Entity ID)**: `[YOUR_CLERK_ENTITY_ID]`
90+
- **Reply URL (Assertion Consumer Service URL)**: `[YOUR_CLERK_REPLY_URL]`
91+
1. Select **Save** at the top of the panel. Close the panel.
8292

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**
8894

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:
9096

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:
98+
99+
- Claim name: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`
100+
- Value: `user.mail`
101+
102+
First name (optional):
103+
104+
- Claim name: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname`
105+
- Value: `user.givenname`
106+
107+
First name (optional):
108+
109+
- Claim name: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname`
110+
- Value: `user.surname`
111+
112+
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.
96132

97133
## Enable the connection in Clerk
98134

99-
<Include src="_partials/authentication/saml/enable-connection" />
135+
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**.
100144
</Steps>

0 commit comments

Comments
 (0)