Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

[Doc] Add SSO documentation

Gildasb69a472dafa2
diff --git a/doc/src/content/docs/developers/sso.mdx b/doc/src/content/docs/developers/sso.mdx
new file mode 100644
index 00000000..70acea35
--- /dev/null
+++ b/doc/src/content/docs/developers/sso.mdx
@@ -0,0 +1,88 @@
+---
+title: Configuring SSO
+description: This document explains how to configure SSO for Atomic CRM.
+---
+
+## Enable SSO in Supabase
+
+In _Authentication > Sign in / Providers_, enable _SAML 2.0_
+![Supabase SAML](../../images/sso-google-8.png)
+
+## Setup Google Workplace
+
+1. **Open your [Google Workplace Console](https://admin.google.com/) and go to _Apps > Web and mobile apps_**
+ ![Google Workplace Console Web and mobile apps](../../images/sso-google-1.png)
+
+2. **Choose to add custom SAML app**
+ ![Web and mobile apps menu](../../images/sso-google-2.png)
+
+3. **Fill out app details**
+
+ The information you enter here is for visibility into your Google Workspace. You can choose any values you like. _Atomic CRM_ as a name works well for most use cases. Optionally enter a description and a logo.
+ ![New app details screen](../../images/sso-google-3.png)
+
+4. **Download IdP metadata**
+
+ This is a very important step. Click on _DOWNLOAD METADATA_ and save the file that was downloaded. You will need to upload this file later.
+ ![IdP metadata screen](../../images/sso-google-4.png)
+
+
+5. **Add service provider details**
+
+ Fill out these service provider details on the next screen. Replace `<project>` with your Supabase project identifier in the URLs below.
+
+ | Detail | Value |
+ |--------|-------|
+ | ACS URL | https://&lt;project&gt;.supabase.co/auth/v1/sso/saml/acs |
+ | Entity ID | https://&lt;project&gt;.supabase.co/auth/v1/sso/saml/metadata |
+ | Start URL | Your application URL (optional) |
+ | Name ID format | EMAIL |
+ | Name ID | Basic Information > Primary email |
+
+ ![Service provider details screen](../../images/sso-google-5.png)
+
+6. **Configure attribute mapping**
+
+ To properly map the identity details to the sales fields in Atomic CRM, add the following mappings:
+
+ | Google Directory attributes | App attributes |
+ |-----------------------------|----------------|
+ | Primary email | `email` |
+ | First name | `first_name` |
+ | Last name | `last_name` |
+
+ ![Attribute mapping screen](../../images/sso-google-6.png)
+
+7. **Configure user access**
+
+ You can configure which Google Workspace user accounts will get access to Atomic CRM. This is important if you wish to limit access to your software engineering teams.
+
+ You can configure this access by clicking on the _User access_ card (or down-arrow). Follow the instructions on screen.
+ ![App details screen](../../images/sso-google-7.png)
+
+8. **Save the following JSON in a mapping.json file**
+ ```json
+ {
+ "keys": {
+ "email": {
+ "name": "email"
+ },
+ "first_name": {
+ "name": "first_name"
+ },
+ "last_name": {
+ "name": "last_name"
+ }
+ }
+ }
+ ```
+
+9. **Register the SSO Provider**
+
+ Run the following command:
+ ```sh
+ npx supabase sso add --type saml --project-ref <your-project> \
+ --metadata-file /path/to/saml/metadata.xml \
+ --attribute-mapping-file /path/to/mapping.json \
+ --domains company.com
+ ```
diff --git a/doc/src/content/images/sso-google-1.png b/doc/src/content/images/sso-google-1.png
new file mode 100644
index 00000000..eb003bc9
Binary files /dev/null and b/doc/src/content/images/sso-google-1.png differ
diff --git a/doc/src/content/images/sso-google-2.png b/doc/src/content/images/sso-google-2.png
new file mode 100644
index 00000000..17e852a5
Binary files /dev/null and b/doc/src/content/images/sso-google-2.png differ
diff --git a/doc/src/content/images/sso-google-3.png b/doc/src/content/images/sso-google-3.png
new file mode 100644
index 00000000..260076be
Binary files /dev/null and b/doc/src/content/images/sso-google-3.png differ
diff --git a/doc/src/content/images/sso-google-4.png b/doc/src/content/images/sso-google-4.png
new file mode 100644
index 00000000..3b02de5e
Binary files /dev/null and b/doc/src/content/images/sso-google-4.png differ
diff --git a/doc/src/content/images/sso-google-5.png b/doc/src/content/images/sso-google-5.png
new file mode 100644
index 00000000..f7cc4326
Binary files /dev/null and b/doc/src/content/images/sso-google-5.png differ
diff --git a/doc/src/content/images/sso-google-6.png b/doc/src/content/images/sso-google-6.png
new file mode 100644
index 00000000..00ff977b
Binary files /dev/null and b/doc/src/content/images/sso-google-6.png differ
diff --git a/doc/src/content/images/sso-google-7.png b/doc/src/content/images/sso-google-7.png
new file mode 100644
index 00000000..0edecedd
Binary files /dev/null and b/doc/src/content/images/sso-google-7.png differ
diff --git a/doc/src/content/images/sso-google-8.png b/doc/src/content/images/sso-google-8.png
new file mode 100644
index 00000000..a8a847cf
Binary files /dev/null and b/doc/src/content/images/sso-google-8.png differ