From 3b126291a673d42933b22bf3170a795e6ee646ff Mon Sep 17 00:00:00 2001
From: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com>
Date: Wed, 19 Mar 2025 12:36:46 +0530
Subject: [PATCH] docs: removed XM & Survey -> SAML SSO (#4999)
---
apps/web/modules/auth/types/auth.ts | 6 +++
apps/web/modules/ee/sso/lib/sso-handlers.ts | 11 ++++-
.../setup-saml-with-identity-providers.mdx | 34 +++++++++++++--
docs/mint.json | 4 --
.../configuration/auth-sso/saml-sso.mdx | 6 +--
.../enterprise-features/saml-sso.mdx | 43 -------------------
packages/lib/messages/de-DE.json | 3 --
packages/lib/messages/en-US.json | 3 --
packages/lib/messages/fr-FR.json | 3 --
packages/lib/messages/pt-BR.json | 3 --
packages/lib/messages/pt-PT.json | 3 --
packages/lib/messages/zh-Hant-TW.json | 3 --
12 files changed, 49 insertions(+), 73 deletions(-)
delete mode 100644 docs/xm-and-surveys/enterprise-features/saml-sso.mdx
diff --git a/apps/web/modules/auth/types/auth.ts b/apps/web/modules/auth/types/auth.ts
index e8aad424af..cabe46a5b3 100644
--- a/apps/web/modules/auth/types/auth.ts
+++ b/apps/web/modules/auth/types/auth.ts
@@ -3,3 +3,9 @@ export type TOidcNameFields = {
family_name?: string;
preferred_username?: string;
};
+
+export type TSamlNameFields = {
+ name?: string;
+ firstName?: string;
+ lastName?: string;
+};
diff --git a/apps/web/modules/ee/sso/lib/sso-handlers.ts b/apps/web/modules/ee/sso/lib/sso-handlers.ts
index af40ab23dc..9ec9557e74 100644
--- a/apps/web/modules/ee/sso/lib/sso-handlers.ts
+++ b/apps/web/modules/ee/sso/lib/sso-handlers.ts
@@ -1,7 +1,7 @@
import { createBrevoCustomer } from "@/modules/auth/lib/brevo";
import { getUserByEmail, updateUser } from "@/modules/auth/lib/user";
import { createUser } from "@/modules/auth/lib/user";
-import { TOidcNameFields } from "@/modules/auth/types/auth";
+import { TOidcNameFields, TSamlNameFields } from "@/modules/auth/types/auth";
import { getIsSamlSsoEnabled, getisSsoEnabled } from "@/modules/ee/license-check/lib/utils";
import type { IdentityProvider } from "@prisma/client";
import type { Account } from "next-auth";
@@ -93,6 +93,15 @@ export const handleSSOCallback = async ({ user, account }: { user: TUser; accoun
}
}
+ if (provider === "saml") {
+ const samlUser = user as TUser & TSamlNameFields;
+ if (samlUser.name) {
+ userName = samlUser.name;
+ } else if (samlUser.firstName || samlUser.lastName) {
+ userName = `${samlUser.firstName} ${samlUser.lastName}`;
+ }
+ }
+
const userProfile = await createUser({
name:
userName ||
diff --git a/docs/development/guides/auth-and-provision/setup-saml-with-identity-providers.mdx b/docs/development/guides/auth-and-provision/setup-saml-with-identity-providers.mdx
index ddcd112cbf..5df536e85f 100644
--- a/docs/development/guides/auth-and-provision/setup-saml-with-identity-providers.mdx
+++ b/docs/development/guides/auth-and-provision/setup-saml-with-identity-providers.mdx
@@ -21,15 +21,41 @@ This guide explains the settings you need to use to configure SAML with your Ide
**Assertion Encryption:** Unencrypted
+**NameID Format:** EmailAddress
+
+**Application username:** email
+
**Mapping Attributes / Attribute Statements:**
-- [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier) -> id
+- Name claim:
-- [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress) -> email
+ If your IdP has a `name` claim, set the following claims to populate the name field:
-- [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname) -> firstName
+ | Name | Name Format | Value |
+ | ---- | ----------- | --------- |
+ | name | Basic | user.name |
-- [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname) -> lastName
+ Many IdPs do not have a `name` claim. If not, you can use different claims to populate the name field. The order of precedence is `name` -> **other options** -> `email`.
+
+ **Other options:**
+
+ | Name | Name Format | Value |
+ | --------- | ----------- | ------------------------- |
+ | firstName | Basic | **FIRST_NAME_EQUIVALENT** |
+ | lastName | Basic | **LAST_NAME_EQUIVALENT** |
+
+ Refer to the table below for the different claims you can use for each IdP.
+
+ | IdP | FIRST_NAME_EQUIVALENT | LAST_NAME_EQUIVALENT |
+ | ----------------------------- | -------------------------------- | -------------------------------- |
+ | Okta | user.firstName | user.lastName |
+ | Microsoft Entra ID (Azure AD) | user.givenName | user.surname |
+ | Google Workspace | user.given_name / user.firstName | user.family_name / user.lastName |
+ | OneLogin | user.FirstName / user.first_name | user.LastName / user.last_name |
+ | Auth0 | user.given_name | user.family_name |
+ | JumpCloud | user.firstname | user.lastname |
+
+ Above provided claims may differ based on your configuration and the IdP you are using. Please refer to the documentation of your IdP for the correct claims.
### SAML With Okta
diff --git a/docs/mint.json b/docs/mint.json
index 562973b528..132aad2818 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -141,10 +141,6 @@
"xm-and-surveys/core-features/test-environment"
]
},
- {
- "group": "Enterprise Features",
- "pages": ["xm-and-surveys/enterprise-features/saml-sso"]
- },
{
"group": "XM",
"pages": [
diff --git a/docs/self-hosting/configuration/auth-sso/saml-sso.mdx b/docs/self-hosting/configuration/auth-sso/saml-sso.mdx
index 39db134cab..64ee1355f6 100644
--- a/docs/self-hosting/configuration/auth-sso/saml-sso.mdx
+++ b/docs/self-hosting/configuration/auth-sso/saml-sso.mdx
@@ -1,5 +1,5 @@
---
-title: "SAML SSO - Self-hosted"
+title: "SAML SSO"
icon: "user-shield"
description: "Configure SAML Single Sign-On (SSO) for secure enterprise authentication with your Formbricks instance."
---
@@ -71,7 +71,7 @@ To configure SAML SSO in Formbricks, follow these steps:
Configure a dedicated database for SAML by setting the `SAML_DATABASE_URL` environment variable in your `docker-compose.yml` file (e.g., `postgres://postgres:postgres@postgres:5432/formbricks-saml`). If you're using a self-signed certificate for Postgres, include the `sslmode=disable` parameter.
-
+
Create a SAML application in your IdP by following your provider's instructions([SAML Setup](/development/guides/auth-and-provision/setup-saml-with-identity-providers))
@@ -79,7 +79,7 @@ To configure SAML SSO in Formbricks, follow these steps:
Provision users in your IdP and configure access to the IdP SAML app for all your users (who need access to Formbricks).
-
+
Keep the XML metadata from your IdP handy for the next step.
diff --git a/docs/xm-and-surveys/enterprise-features/saml-sso.mdx b/docs/xm-and-surveys/enterprise-features/saml-sso.mdx
deleted file mode 100644
index 1f929f7bbc..0000000000
--- a/docs/xm-and-surveys/enterprise-features/saml-sso.mdx
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: "SAML SSO"
-icon: "user-shield"
-description: "How to set up SAML SSO for Formbricks"
----
-
-This feature is only available with the Formbricks Enterprise plan having a SAML SSO add-on.
-
-## Overview
-
-Formbricks supports Security Assertion Markup Language (SAML) SSO. We prioritize your ease of access and security by providing robust Single Sign-On (SSO) capabilities.
-
-### Setting up SAML login
-
-
-
- Follow the instructions here - [SAML
- Setup](/development/guides/auth-and-provision/setup-saml-with-identity-providers)
-
-
- Ensure that all users who need access to Formbricks have access to the IdP SAML app.
-
-
- Keep the XML metadata from your IdP accessible, as you will need it later.
-
-
- Set the `SAML_DATABASE_URL` environment variable in your `.env` file to a dedicated database for
- SAML(e.g., `postgresql://postgres:@localhost:5432/formbricks-saml`). If you're using a self-signed
- certificate for Postgres, include the `sslmode=disable` parameter.
-
-
- Create a file called `connection.xml` in the `apps/web/saml-connection` directory and paste the XML
- metadata from your IdP into it. Please create the directory if it doesn't exist. Your metadata file should start with a tag like this: `<...>` or ``. Please remove any extra text from the metadata.
-
-
- Once setup is complete, please restart the Formbricks server and your users can log into Formbricks using SAML.
-
-
-
-
- We don't support multiple SAML connections yet. You can only have one SAML connection at a time. If you
- change the `connection.xml` file, your existing SAML connection will be overwritten.
-
diff --git a/packages/lib/messages/de-DE.json b/packages/lib/messages/de-DE.json
index c1e471dd14..87cc11bea7 100644
--- a/packages/lib/messages/de-DE.json
+++ b/packages/lib/messages/de-DE.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "Formbricks SDK ist verbunden",
"formbricks_sdk_not_connected": "Formbricks SDK ist noch nicht verbunden.",
"formbricks_sdk_not_connected_description": "Verbinde deine Website oder App mit Formbricks",
- "function": "Funktion",
"have_a_problem": "Hast Du ein Problem?",
"how_to_setup": "Wie einrichten",
"how_to_setup_description": "Befolge diese Schritte, um das Formbricks Widget in deiner App einzurichten.",
@@ -824,10 +823,8 @@
"step_3": "Schritt 3: Debug-Modus",
"switch_on_the_debug_mode_by_appending": "Schalte den Debug-Modus ein, indem Du anhängst",
"tag_of_your_app": "Tag deiner App",
- "to_the": "zur",
"to_the_url_where_you_load_the": "URL, wo Du die lädst",
"want_to_learn_how_to_add_user_attributes": "Willst Du lernen, wie man Attribute hinzufügt?",
- "you_also_need_to_pass_a": "du musst auch eine bestehen",
"you_are_done": "Du bist fertig \uD83C\uDF89",
"you_can_set_the_user_id_with": "du kannst die Benutzer-ID festlegen mit",
"your_app_now_communicates_with_formbricks": "Deine App kommuniziert jetzt mit Formbricks - sie sendet Ereignisse und lädt Umfragen automatisch!"
diff --git a/packages/lib/messages/en-US.json b/packages/lib/messages/en-US.json
index c5024466f3..491f87d2ef 100644
--- a/packages/lib/messages/en-US.json
+++ b/packages/lib/messages/en-US.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "Formbricks SDK is connected",
"formbricks_sdk_not_connected": "Formbricks SDK is not yet connected.",
"formbricks_sdk_not_connected_description": "Connect your website or app with Formbricks",
- "function": "function",
"have_a_problem": "Have a problem?",
"how_to_setup": "How to setup",
"how_to_setup_description": "Follow these steps to setup the Formbricks widget within your app.",
@@ -824,10 +823,8 @@
"step_3": "Step 3: Debug mode",
"switch_on_the_debug_mode_by_appending": "Switch on the debug mode by appending",
"tag_of_your_app": "tag of your app",
- "to_the": "to the",
"to_the_url_where_you_load_the": "to the URL where you load the",
"want_to_learn_how_to_add_user_attributes": "Want to learn how to add user attributes, custom events and more?",
- "you_also_need_to_pass_a": "you also need to pass a",
"you_are_done": "You're done \uD83C\uDF89",
"you_can_set_the_user_id_with": "you can set the user id with",
"your_app_now_communicates_with_formbricks": "Your app now communicates with Formbricks - sending events, and loading surveys automatically!"
diff --git a/packages/lib/messages/fr-FR.json b/packages/lib/messages/fr-FR.json
index 07e9bab22c..c555b8a815 100644
--- a/packages/lib/messages/fr-FR.json
+++ b/packages/lib/messages/fr-FR.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "Le SDK Formbricks est connecté",
"formbricks_sdk_not_connected": "Le SDK Formbricks n'est pas encore connecté.",
"formbricks_sdk_not_connected_description": "Connectez votre site web ou votre application à Formbricks.",
- "function": "fonction",
"have_a_problem": "Vous avez un problème ?",
"how_to_setup": "Comment configurer",
"how_to_setup_description": "Suivez ces étapes pour configurer le widget Formbricks dans votre application.",
@@ -824,10 +823,8 @@
"step_3": "Étape 3 : Mode débogage",
"switch_on_the_debug_mode_by_appending": "Activez le mode débogage en ajoutant",
"tag_of_your_app": "étiquette de votre application",
- "to_the": "au",
"to_the_url_where_you_load_the": "vers l'URL où vous chargez le",
"want_to_learn_how_to_add_user_attributes": "Vous voulez apprendre à ajouter des attributs utilisateur, des événements personnalisés et plus encore ?",
- "you_also_need_to_pass_a": "vous devez également passer un",
"you_are_done": "Vous avez terminé \uD83C\uDF89",
"you_can_set_the_user_id_with": "vous pouvez définir l'ID utilisateur avec",
"your_app_now_communicates_with_formbricks": "Votre application communique désormais avec Formbricks - envoyant des événements et chargeant des enquêtes automatiquement !"
diff --git a/packages/lib/messages/pt-BR.json b/packages/lib/messages/pt-BR.json
index 46421e2444..d69201734d 100644
--- a/packages/lib/messages/pt-BR.json
+++ b/packages/lib/messages/pt-BR.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "O SDK do Formbricks está conectado",
"formbricks_sdk_not_connected": "O SDK do Formbricks ainda não está conectado.",
"formbricks_sdk_not_connected_description": "Conecte seu site ou app com o Formbricks",
- "function": "função",
"have_a_problem": "Tá com problema?",
"how_to_setup": "Como configurar",
"how_to_setup_description": "Siga esses passos para configurar o widget do Formbricks no seu app.",
@@ -824,10 +823,8 @@
"step_3": "Passo 3: Modo de depuração",
"switch_on_the_debug_mode_by_appending": "Ative o modo de depuração adicionando",
"tag_of_your_app": "etiqueta do seu app",
- "to_the": "pro",
"to_the_url_where_you_load_the": "para a URL onde você carrega o",
"want_to_learn_how_to_add_user_attributes": "Quer aprender como adicionar atributos de usuário, eventos personalizados e mais?",
- "you_also_need_to_pass_a": "você também precisa passar um",
"you_are_done": "Você terminou \uD83C\uDF89",
"you_can_set_the_user_id_with": "você pode definir o id do usuário com",
"your_app_now_communicates_with_formbricks": "Seu app agora se comunica com o Formbricks - enviando eventos e carregando pesquisas automaticamente!"
diff --git a/packages/lib/messages/pt-PT.json b/packages/lib/messages/pt-PT.json
index 432cf16988..bbe35a5153 100644
--- a/packages/lib/messages/pt-PT.json
+++ b/packages/lib/messages/pt-PT.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "O SDK do Formbricks está conectado",
"formbricks_sdk_not_connected": "O SDK do Formbricks ainda não está conectado",
"formbricks_sdk_not_connected_description": "Ligue o seu website ou aplicação ao Formbricks",
- "function": "função",
"have_a_problem": "Tem um problema?",
"how_to_setup": "Como configurar",
"how_to_setup_description": "Siga estes passos para configurar o widget Formbricks na sua aplicação.",
@@ -824,10 +823,8 @@
"step_3": "Passo 3: Modo de depuração",
"switch_on_the_debug_mode_by_appending": "Ativar o modo de depuração adicionando",
"tag_of_your_app": "tag da sua aplicação",
- "to_the": "para o",
"to_the_url_where_you_load_the": "para o URL onde carrega o",
"want_to_learn_how_to_add_user_attributes": "Quer aprender a adicionar atributos de utilizador, eventos personalizados e mais?",
- "you_also_need_to_pass_a": "também precisa passar um",
"you_are_done": "Está concluído \uD83C\uDF89",
"you_can_set_the_user_id_with": "pode definir o ID do utilizador com",
"your_app_now_communicates_with_formbricks": "A sua aplicação agora comunica com o Formbricks - enviando eventos e carregando inquéritos automaticamente!"
diff --git a/packages/lib/messages/zh-Hant-TW.json b/packages/lib/messages/zh-Hant-TW.json
index fd469906ab..c5205b2505 100644
--- a/packages/lib/messages/zh-Hant-TW.json
+++ b/packages/lib/messages/zh-Hant-TW.json
@@ -804,7 +804,6 @@
"formbricks_sdk_connected": "Formbricks SDK 已連線",
"formbricks_sdk_not_connected": "Formbricks SDK 尚未連線。",
"formbricks_sdk_not_connected_description": "將您的網站或應用程式與 Formbricks 連線",
- "function": "函式",
"have_a_problem": "有問題嗎?",
"how_to_setup": "如何設定",
"how_to_setup_description": "請按照這些步驟在您的應用程式中設定 Formbricks 小工具。",
@@ -824,10 +823,8 @@
"step_3": "步驟 3:偵錯模式",
"switch_on_the_debug_mode_by_appending": "藉由附加以下項目開啟偵錯模式",
"tag_of_your_app": "您應用程式的標籤",
- "to_the": "到",
"to_the_url_where_you_load_the": "到您載入",
"want_to_learn_how_to_add_user_attributes": "想瞭解如何新增使用者屬性、自訂事件等嗎?",
- "you_also_need_to_pass_a": "您還需要傳遞",
"you_are_done": "您已完成 \uD83C\uDF89",
"you_can_set_the_user_id_with": "您可以使用 user id 設定",
"your_app_now_communicates_with_formbricks": "您的應用程式現在可與 Formbricks 通訊 - 自動傳送事件和載入問卷!"