SSO Setup Guide

Configure SAML-based Single Sign-On for your organization. Supports Okta, Azure AD, Google Workspace, OneLogin, and any SAML 2.0 identity provider.

๐Ÿ“‹ Prerequisites

SSO requires an organization with owner role. Create one via POST /api/v1/organizations first.

Step 1: Get Your SAML Metadata

Fetch PrivaBase's Service Provider (SP) metadata for your organization:

curl https://api.privabase.com/api/v1/organizations/YOUR_ORG_ID/sso/metadata \
  -H "Authorization: Bearer YOUR_TOKEN"

This returns:

Step 2: Configure Your Identity Provider

In your IdP (Okta, Azure AD, etc.), create a new SAML application using the metadata from Step 1.

Okta

  1. Go to Applications โ†’ Create App Integration โ†’ SAML 2.0
  2. Set Single sign-on URL to the ACS URL from Step 1
  3. Set Audience URI (SP Entity ID) to the Entity ID from Step 1
  4. Map attributes: email โ†’ user.email, firstName โ†’ user.firstName, lastName โ†’ user.lastName
  5. Download the IdP metadata XML or copy the Entity ID, SSO URL, and certificate

Azure AD

  1. Go to Enterprise Applications โ†’ New Application โ†’ Non-gallery application
  2. Under Single sign-on โ†’ SAML, set the Identifier (Entity ID) and Reply URL (ACS)
  3. Download the Federation Metadata XML or the Base64 Certificate

Google Workspace

  1. Admin Console โ†’ Apps โ†’ Web and mobile apps โ†’ Add custom SAML app
  2. Enter the ACS URL and Entity ID
  3. Map attributes: Primary email โ†’ email
  4. Download the IdP metadata

Step 3: Configure SSO in PrivaBase

Send your IdP's SAML configuration to PrivaBase:

curl -X POST https://api.privabase.com/api/v1/organizations/YOUR_ORG_ID/sso \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "entityId": "https://idp.example.com/saml/metadata",
    "ssoUrl": "https://idp.example.com/saml/sso",
    "certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
    "emailDomain": "company.com"
  }'
FieldDescription
entityIdYour IdP's Entity ID / Issuer URL
ssoUrlYour IdP's SAML SSO endpoint
certificateYour IdP's X.509 signing certificate (PEM format)
emailDomainEmail domain for SSO enforcement (e.g. company.com)

Step 4: Test SSO Login

After configuration, users with @company.com email addresses will be redirected to your IdP during login. Test by logging in with a domain-matching email.

Disable SSO

curl -X DELETE https://api.privabase.com/api/v1/organizations/YOUR_ORG_ID/sso \
  -H "Authorization: Bearer YOUR_TOKEN"
โš ๏ธ Disabling SSO

Disabling SSO won't lock out users. They can still log in with email/password. Existing sessions remain valid.