docs: removed XM & Survey -> SAML SSO (#4999)

This commit is contained in:
Piyush Gupta
2025-03-19 12:36:46 +05:30
committed by GitHub
parent 55a230e127
commit 3b126291a6
12 changed files with 49 additions and 73 deletions

View File

@@ -3,3 +3,9 @@ export type TOidcNameFields = {
family_name?: string;
preferred_username?: string;
};
export type TSamlNameFields = {
name?: string;
firstName?: string;
lastName?: string;
};

View File

@@ -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 ||

View File

@@ -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

View File

@@ -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": [

View File

@@ -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:
<Step title="Database Setup">
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.
</Step>
<Step title="IdP Application">
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))
</Step>
@@ -79,7 +79,7 @@ To configure SAML SSO in Formbricks, follow these steps:
<Step title="User Provisioning">
Provision users in your IdP and configure access to the IdP SAML app for all your users (who need access to Formbricks).
</Step>
<Step title="Metadata">
Keep the XML metadata from your IdP handy for the next step.
</Step>

View File

@@ -1,43 +0,0 @@
---
title: "SAML SSO"
icon: "user-shield"
description: "How to set up SAML SSO for Formbricks"
---
<Note>This feature is only available with the Formbricks Enterprise plan having a SAML SSO add-on.</Note>
## 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
<Steps>
<Step title="Create a SAML application with your Identity Provider (IdP)">
Follow the instructions here - [SAML
Setup](/development/guides/auth-and-provision/setup-saml-with-identity-providers)
</Step>
<Step title="Configure access to the IdP SAML app">
Ensure that all users who need access to Formbricks have access to the IdP SAML app.
</Step>
<Step title="Retrieve XML metadata from your IdP">
Keep the XML metadata from your IdP accessible, as you will need it later.
</Step>
<Step title="Set the SAML_DATABASE_URL environment variable">
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.
</Step>
<Step title="Set the metadata">
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: `<?xml version="1.0" encoding="UTF-8"?><...>` or `<md:EntityDescriptor entityID="...">`. Please remove any extra text from the metadata.
</Step>
<Step title="Your users can now log into Formbricks using SAML">
Once setup is complete, please restart the Formbricks server and your users can log into Formbricks using SAML.
</Step>
</Steps>
<Note>
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.
</Note>

View File

@@ -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!"

View File

@@ -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!"

View File

@@ -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 !"

View File

@@ -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!"

View File

@@ -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!"

View File

@@ -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 通訊 - 自動傳送事件和載入問卷!"