Help Docs
Enabling SSO
EDocGen supports SAML-based Single Sign-On (SSO) for seamless organization-wide authentication. This guide walks you through configuring SSO using our API, which registers your Identity Provider (IdP) metadata—like from Okta or Microsoft Entra ID —and enables secure login redirects.
Prerequisites
- Admin access to your IdP to download SAML metadata XML.
- A valid EDocGen API access token (JWT). Generate one from your account settings.
- Base URL: https://app.edocgen.com
Step 1: Gather Your IdP Metadata
From your IdP admin console:
- Download the SAML metadata XML file. It includes:
- Entity ID
- Signing certificate
- SSO login/logout endpoints
- Save the full XML content (starts with <EntityDescriptor>).
Step 2: Configure SSO via API
Send a POST request to /api/v1/sso/connections.
Headers:
x-access-token: <your-jwt-token>
Content-Type: application/json
Body:
JSON
{
"tenant": "okta-test",
"product": "edocgen",
"defaultRedirectUrl": "https://app.edocgen.com",
"redirectUrl": [
"https://app.edocgen.com/*"
],
"rawMetadata": "<your-SAML-metadata-XML-here>"
}
Field Breakdown:
- tenant: Your organization's unique ID (e.g., "okta-test").
- product: Use "edocgen".
- defaultRedirectUrl: Where users land after login (e.g., dashboard).
- redirectUrl: Array of allowed redirect patterns (wildcards like /* supported).
- rawMetadata: Paste the full SAML XML string from your IdP.
Step 3: Test the Configuration
- Attempt login at https://app.edocgen.com.
- Users will redirect to your IdP for authentication.
- Successful login returns them to the defaultRedirectUrl.
Example cURL Request
bash
curl -X POST https://app.edocgen.com/api/v1/sso/connections \
-H "x-access-token: your-jwt-here" \
-H "Content-Type: application/json" \
-d '{
"tenant": "my-org",
"product": "edocgen",
"defaultRedirectUrl": "https://app.edocgen.com/dashboard",
"redirectUrl": ["https://app.edocgen.com/*"],
"rawMetadata": "<EntityDescriptor...full XML...>"
}'
Troubleshooting
- Invalid metadata: Ensure XML is complete and unescaped.
- Redirect failures: Check redirectUrl wildcards match exactly.
- Token errors: Regenerate your JWT if expired.
- Response: Success returns 201 with connection details; errors include helpful messages.
Once set up, all users in that tenant authenticate via your IdP—no more separate EDocGen passwords needed!