Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

completed Azure SAML, started on Azure SCIM

Steven Tey7167cc0549dc
diff --git a/app/ui/content/copy-box.tsx b/app/ui/content/copy-box.tsx
index 51beafadd5..00b8b20de6 100644
--- a/app/ui/content/copy-box.tsx
+++ b/app/ui/content/copy-box.tsx
@@ -7,7 +7,7 @@ import { toast } from "sonner";
export default function CopyBox(props) {
const [copied, setCopied] = useState(false);
return (
- <div className="not-prose rounded-xl border border-gray-200 bg-white p-4">
+ <div className="not-prose my-4 rounded-xl border border-gray-200 bg-white p-4">
<p>{props.title}</p>
<div className="mt-1 flex w-full items-center justify-between rounded-md bg-gray-100 p-1.5 pl-3">
<div className="overflow-auto scrollbar-hide">
diff --git a/components/app/modals/saml-modal.tsx b/components/app/modals/saml-modal.tsx
index b6aa33a2f7..6c6f71688e 100644
--- a/components/app/modals/saml-modal.tsx
+++ b/components/app/modals/saml-modal.tsx
@@ -103,7 +103,7 @@ function SAMLModal({
</a>
</div>
- {selectedProvider === "okta" && (
+ {(selectedProvider === "okta" || selectedProvider === "azure") && (
<div className="border-t border-gray-200 pt-4">
<div className="flex items-center space-x-1">
<h2 className="text-sm font-medium text-gray-900">
diff --git a/components/app/modals/scim-modal.tsx b/components/app/modals/scim-modal.tsx
index bba5ce33c5..cc8043a58e 100644
--- a/components/app/modals/scim-modal.tsx
+++ b/components/app/modals/scim-modal.tsx
@@ -34,13 +34,18 @@ function SCIMModal({
const [showBearerToken, setShowBearerToken] = useState(false);
const [copiedBearerToken, setCopiedBearerToken] = useState(false);
+ const currentProvider = useMemo(
+ () => SAML_PROVIDERS.find((p) => p.scim === provider),
+ [provider],
+ ) as SAMLProviderProps;
+
return (
<Modal showModal={showSCIMModal} setShowModal={setShowSCIMModal}>
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-8 sm:px-16">
{configured ? (
<div className="flex items-center space-x-3 py-4">
<img
- src={SAML_PROVIDERS.find((p) => p.scim === provider)!.logo}
+ src={currentProvider.logo}
alt={`${provider} logo`}
className="h-10 w-10"
/>
@@ -55,7 +60,7 @@ function SCIMModal({
<h3 className="text-lg font-medium">
{configured
- ? `${SAML_PROVIDERS.find((p) => p.scim === provider)!.name} SCIM`
+ ? `${currentProvider.name} SCIM`
: "Configure Directory Sync"}
</h3>
<p className="text-center text-sm text-gray-500">
@@ -133,7 +138,7 @@ function SCIMModal({
<div>
<div className="flex items-center space-x-1">
<h2 className="text-sm font-medium text-gray-900">
- SCIM 2.0 Base URL
+ {currentProvider.scimModalCopy.url}
</h2>
<InfoTooltip
content={
@@ -173,7 +178,7 @@ function SCIMModal({
<div>
<div className="flex items-center space-x-1">
<h2 className="text-sm font-medium text-gray-900">
- OAuth Bearer Token
+ {currentProvider.scimModalCopy.token}
</h2>
<InfoTooltip
content={
diff --git a/content/help/azure-saml.mdx b/content/help/azure-saml.mdx
index 15f19b890c..c0080d34f7 100644
--- a/content/help/azure-saml.mdx
+++ b/content/help/azure-saml.mdx
@@ -1,5 +1,5 @@
---
-title: Configuring SAML SSO with Azure AD
+title: Configuring SAML SSO with Azure Active Directory
updatedAt: 2023-08-15
summary: For Dub Enterprise users, you can securely manage your team's access to Dub using Azure AD SAML SSO.
author: steventey
@@ -83,143 +83,109 @@ Under the **Basic SAML Configuration** section, click on **Edit**.
hideCaption={true}
/>
+This will open up a sheet overlay. Under **Basic SAML Configuration**, enter the following values:
+
+<CopyBox title="Identifier (Entity ID)" copy="https://saml.dub.co" />
+
<CopyBox
- title="Single sign-on URL"
+ title="Reply URL (Assertion Consumer Service URL)"
copy="https://api.dub.co/auth/saml/callback"
/>
-<CopyBox title="Audience URI (SP Entity ID)" copy="https://saml.dub.co" />
-
<Image
- alt="SAML Settings page on the Okta Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-urls.png"
- width={3014}
+ alt="Basic SAML Configuration section on the Azure Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-basic-saml.png"
+ width={3024}
height={1720}
hideCaption={true}
/>
-Right below the "General" section, you'll see the "Attribute Statements" section.
+Click **Save** in the menu bar to save your changes.
<Image
- alt="Attribute Statements section on the Okta Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-attributes.png"
- width={1578}
- height={1024}
+ alt="Basic SAML Configuration section on the Azure Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-save-saml.png"
+ width={1788}
+ height={1062}
hideCaption={true}
/>
-Click on "Add Row" and add the following attribute statements:
+## Step 3: Attribute Mapping
-| Name | Value |
-| ----------- | ---------------- |
-| `id` | `user.id` |
-| `email` | `user.email` |
-| `firstName` | `user.firstName` |
-| `lastName` | `user.lastName` |
+Click **Edit** on the **Attributes & Claims** section.
-Once that's done, click "Next".
+<Image
+ alt="Attributes & Claims section on the Azure Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-attributes.png"
+ width={2478}
+ height={1580}
+ hideCaption={true}
+/>
-## Step 3: Submit Feedback
+Under **Additional claims**, make sure the following entries are present:
-Under the "Feedback" section, select "I'm an Okta customer adding an internal app" and click "Finish".
+| Name | Value |
+| ------------------------------------------------------------------ | ---------------------- |
+| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress | user.mail |
+| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname | user.givenname |
+| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name | user.userprincipalname |
+| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname | user.surname |
<Image
- alt="Feedback section on the Okta Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-feedback.png"
- width={2244}
- height={1430}
+ alt="Additional claims section on the Azure Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-attributes-claims.png"
+ width={1772}
+ height={1004}
hideCaption={true}
/>
+Once that's done, click on the `X` button in the top right corner to go back to the main settings page (or click the back button in your browser).
+
## Step 4: Copy the Metadata URL
-After you've submitted the feedback, you'll be redirected to the "Sign On" tab, which contains the metadata URL.
+Scroll down to the 3rd section on the page, **SAML Certificates**. Copy the **App Federation Metadata Url** value and return to the Dub dashboard.
<Image
- alt="Sign On tab on the Okta Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-metadata-url.png"
- width={3024}
- height={1720}
+ alt="Metadata URL on the Azure Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-metadata-url.png"
+ width={2516}
+ height={1408}
hideCaption={true}
/>
-Copy the metadata URL and return to the Dub dashboard.
-
## Step 5: Configure SAML SSO on Dub
-In your project dashboard on Dub, click on the "Settings" tab in the menu bar at the top. Then, click on the "Security" tab in the sidebar.
+In your project dashboard on Dub, click on the **Settings** tab in the menu bar at the top. Then, click on the **Security** tab in the sidebar.
<Image
alt="SAML SSO section on the Dub Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-sso-section.png"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/saml-sso-section.png"
width={2480}
height={1486}
hideCaption={true}
/>
-Under the "SAML Single Sign-On" section, click on "Configure". This will open up the SAML SSO modal:
+Under the **SAML Single Sign-On** section, click on **Configure**. This will open up the SAML SSO modal:
-1. Select "Okta" as the SAML provider.
-2. Enter the Metadata URL value that you copied from Step 4.
-3. Click "Save changes".
+1. Select **Azure AD** as the SAML provider.
+2. Enter the **App Federation Metadata Url** value that you copied from Step 4.
+3. Click **Save changes**.
<Image
alt="SAML SSO Modal"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-modal.png"
- width={2068}
- height={1720}
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-saml-modal.png"
+ width={2022}
+ height={1372}
hideCaption={true}
/>
## Step 6: Assign Users
<Note variant="warning">
- We highly recommend configuring [SCIM Directory Sync](okta-scim) before
+ We highly recommend configuring [SCIM Directory Sync](azure-scim) before
assigning users & groups to your project. This will ensure that your users are
automatically added to your project when they sign in for the first time, as
- well as automatically removed when they are deactivated in Okta.
+ well as automatically removed when they are deactivated in Azure.
</Note>
Once you've configured SAML SSO, you can start assigning users & groups to your project.
-
-Click on the "Assignments" tab, and click "Assign". You can choose to assign users individually, or assign them in bulk by group.
-
-<Image
- alt="Assigning users in Okta"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-assign.png"
- width={2346}
- height={1562}
- hideCaption={true}
-/>
-
-Select the users or groups you want to assign and click "Assign".
-
-<Image
- alt="Assigning users in Okta choose users"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-choose.png"
- width={1564}
- height={1356}
- hideCaption={true}
-/>
-
-In the next screen, scroll to the bottom and click "Save and Go Back".
-
-<Image
- alt="Saving Okta assignment"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-save.png"
- width={3132}
- height={2008}
- hideCaption={true}
-/>
-
-Your assigned users should now receive an invitation email to join your Dub project.
-
-<Image
- alt="Okta SAML invite email"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-invite.png"
- width={2226}
- height={1564}
- hideCaption={true}
-/>
-
-They will also be able to sign in to Dub using Okta SSO.
diff --git a/content/help/azure-scim.mdx b/content/help/azure-scim.mdx
new file mode 100644
index 0000000000..515481706b
--- /dev/null
+++ b/content/help/azure-scim.mdx
@@ -0,0 +1,198 @@
+---
+title: Configuring SCIM Directory Sync with Azure AD
+updatedAt: 2023-08-15
+summary: For Dub Enterprise users, you can automatically provision and deprovision users from Azure AD to Dub using SCIM Directory Sync.
+author: steventey
+categories:
+ - saml-sso
+related:
+ - azure-saml
+excludeHeadingsFromSearch: true
+---
+
+<Note variant="success">
+ This feature is only available on [Dub Enterprise](/pricing).
+</Note>
+
+For Dub Enterprise users, you can automatically provision and deprovision users from your Azure Active Directory (AD) to Dub using [SCIM Directory Sync](https://learn.microsoft.com/en-us/azure/active-directory/architecture/sync-scim).
+
+<Prerequisites>
+
+Before you can configure SCIM Directory Sync, you need to create a SAML application in Azure. See [Configuring SAML SSO with Azure Active Directory](azure-saml) for more information.
+
+</Prerequisites>
+
+## Step 1: Configure Directory Sync on Dub
+
+In your project dashboard on Dub, click on the **Settings** tab in the menu bar at the top. Then, click on the **Security** tab in the sidebar.
+
+<Image
+ alt="Directory Sync section on the Dub Dashboard"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/scim-directory-sync.png"
+ width={2576}
+ height={1608}
+ hideCaption={true}
+/>
+
+Under the **Directory Sync** section, click on **Configure**. This will open up the Directory Sync modal:
+
+1. Select **Azure AD** as the Directory Provider.
+2. Click **Save changes**.
+
+<Image
+ alt="SCIM Modal"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-modal.png"
+ width={1652}
+ height={1008}
+ hideCaption={true}
+/>
+
+This will generate a Directory Sync connection for your Dub project, and return 2 values, which will be needed in Step 2:
+
+1. **Tenant URL**
+2. **Secret Token**
+
+<Image
+ alt="SCIM Modal Configured"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-modal-configured.png"
+ width={1964}
+ height={1356}
+ hideCaption={true}
+/>
+
+## Step 2: Add Provisioning to SAML Application
+
+Click on the **Provisioning** tab of your existing Dub Okta SAML application that you want to enable SCIM provisioning for.
+
+<Image
+ alt="Provisioning tab of Okta SAML application"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-tab.png"
+ width={2982}
+ height={1536}
+ hideCaption={true}
+/>
+
+In the Provisioning tab, click on **Get started**.
+
+<Image
+ alt="Get started with provisioning"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-get-started.png"
+ width={2666}
+ height={1546}
+ hideCaption={true}
+/>
+
+Select **Automatic** from the **Provisioning Mode** dropdown. Under the **Admin Credentials** section, enter the values that you obtained from Step 1:
+
+1. **Tenant URL**
+2. **Secret Token**
+
+<Image
+ alt="Provisioning tab of Azure SAML application"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-provisioning.png"
+ width={2020}
+ height={1176}
+ hideCaption={true}
+/>
+
+Click on **Test Connection** to test the connection to see if the credentials are correct, then click **Save** to save the credentials.
+
+Expand the **Mappings** section and ensure group and user attribute mappings are enabled for your app. The default mapping should work.
+
+<Image
+ alt="Mappings section of Azure SAML application"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/azure-scim-mappings.png"
+ width={1982}
+ height={1154}
+ hideCaption={true}
+/>
+
+1. Under the **SCIM connector base URL** field, enter the **SCIM 2.0 Base URL** value from Step 1.
+
+2. Under **Unique identifier field for users**, enter `userName`.
+
+<CopyBox title="Copy this unique identifier" copy="userName" />
+
+3. Under **Supported provisioning actions**, select the following options:
+
+- Push New Users
+- Push Profile Updates
+- Push groups
+
+4. Under **Authentication Mode**, select **HTTP Header**.
+
+5. Copy & paste the **OAuth Bearer Token** value from Step 1 into the **Authorization** field.
+
+<Image
+ alt="Configure SCIM provisioning"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-scim-connection.png"
+ width={2084}
+ height={1692}
+ hideCaption={true}
+/>
+
+Click "Test Connector Configuration" to verify that the connection is working, and then click "Save".
+
+## Step 3: Configure Provisioning Actions
+
+Under the **To App** section, click **Edit**.
+
+Check the following options, and click **Save**:
+
+- Create Users
+- Update User Attributes
+- Deactivate Users
+
+<Image
+ alt="SCIM Provisioning Actions"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-scim-actions.png"
+ width={2218}
+ height={1688}
+ hideCaption={true}
+/>
+
+## Step 4: Assign Users
+
+Once you've configured Directory sync, you can assign users to Dub directly within Okta.
+
+Click on the **Assignments** tab, and click **Assign**. You can choose to assign users individually, or assign them in bulk by group.
+
+<Image
+ alt="Assigning users in Okta"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-assign.png"
+ width={2346}
+ height={1562}
+ hideCaption={true}
+/>
+
+Select the users or groups you want to assign and click **Assign**.
+
+<Image
+ alt="Assigning users in Okta choose users"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-choose.png"
+ width={1564}
+ height={1356}
+ hideCaption={true}
+/>
+
+In the next screen, scroll to the bottom and click **Save and Go Back**.
+
+<Image
+ alt="Saving Okta assignment"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-save.png"
+ width={3132}
+ height={2008}
+ hideCaption={true}
+/>
+
+Your assigned users should now receive an invitation email to join your Dub project.
+
+<Image
+ alt="Okta SAML invite email"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-invite.png"
+ width={2226}
+ height={1564}
+ hideCaption={true}
+/>
+
+They will also be able to sign in to Dub using Okta SSO.
diff --git a/content/help/okta-saml.mdx b/content/help/okta-saml.mdx
index 1e7f3686f0..945dba4c36 100644
--- a/content/help/okta-saml.mdx
+++ b/content/help/okta-saml.mdx
@@ -132,7 +132,7 @@ In your project dashboard on Dub, click on the **Settings** tab in the menu bar
<Image
alt="SAML SSO section on the Dub Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-saml-sso-section.png"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/saml-sso-section.png"
width={2480}
height={1486}
hideCaption={true}
diff --git a/content/help/okta-scim.mdx b/content/help/okta-scim.mdx
index cd8b2c4126..e12b65c59a 100644
--- a/content/help/okta-scim.mdx
+++ b/content/help/okta-scim.mdx
@@ -28,7 +28,7 @@ In your project dashboard on Dub, click on the **Settings** tab in the menu bar
<Image
alt="Directory Sync section on the Dub Dashboard"
- src="https://d2vwwcvoksz7ty.cloudfront.net/help/okta-scim-directory-sync.png"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/scim-directory-sync.png"
width={2576}
height={1608}
hideCaption={true}
diff --git a/lib/constants/index.ts b/lib/constants/index.ts
index 8081edabda..5b51038975 100644
--- a/lib/constants/index.ts
+++ b/lib/constants/index.ts
@@ -169,17 +169,29 @@ export const SAML_PROVIDERS = [
logo: "/_static/icons/okta.svg",
saml: "okta",
scim: "okta-scim-v2",
+ scimModalCopy: {
+ url: "SCIM 2.0 Base URL",
+ token: "OAuth Bearer Token",
+ },
},
{
name: "Azure AD",
logo: "/_static/icons/azure.svg",
saml: "azure",
scim: "azure-scim-v2",
+ scimModalCopy: {
+ url: "Tenant URL",
+ token: "Secret Token",
+ },
},
{
name: "Google Workspace",
logo: "/_static/icons/google.svg",
saml: "google",
scim: "google",
+ scimModalCopy: {
+ url: "SCIM 2.0 Base URL",
+ token: "OAuth Bearer Token",
+ },
},
];
diff --git a/lib/types.ts b/lib/types.ts
index 04fe2707fa..da9f8620ea 100644
--- a/lib/types.ts
+++ b/lib/types.ts
@@ -123,4 +123,8 @@ export interface SAMLProviderProps {
logo: string;
saml: "okta" | "azure" | "google";
scim: keyof typeof DirectorySyncProviders;
+ scimModalCopy: {
+ url: string;
+ token: string;
+ };
}