Organizations & SSO¶
Organizations¶
Organizations group related tenants together and provide shared SSO configuration. For example, a company with separate Milestone instances for different departments can share a single Microsoft Entra ID setup.

Creating an Organization¶
- Go to the Organizations tab in the admin portal
- Click Create Organization
- Enter the organization name and admin email
- Click Create
Assigning Tenants¶
After creating an organization, assign tenants to it:
- Edit the organization
- Select tenants from the dropdown
- Save changes
Tenants inherit the organization's SSO configuration automatically.
Microsoft Entra ID (SSO)¶
Milestone supports enterprise SSO through Microsoft Entra ID (formerly Azure AD).
Prerequisites¶
- An Azure AD tenant
- An App Registration in Azure AD
- A client secret for the App Registration
- The redirect URI configured in Azure AD
- Outbound HTTPS access from the Milestone server to
login.microsoftonline.comandgraph.microsoft.com(see Network & Firewall Requirements)
Redirect URI¶
Milestone uses a single, shared callback URL for all SSO sign-ins:
One redirect URI for the whole organization
Do not add the tenant path (/t/{slug}/...) to the redirect URI. Milestone carries
the tenant through the sign-in flow internally, so this one URL works for every
tenant in the organization. Register it once per App Registration and reuse it — you do
not need a separate redirect URI per tenant.
Use the same value in three places: the Azure App Registration, the Redirect URI
field in Milestone's SSO configuration, and (single-tenant only) SSO_REDIRECT_URI.
They must match exactly.
Azure AD App Registration¶
- Go to Azure Portal > Azure Active Directory > App Registrations
- Click New Registration
- Set the redirect URI (platform Web) to:
https://your-domain.com/api/auth/sso/callback - Under Certificates & secrets, create a new client secret
- Note the Application (client) ID, Directory (tenant) ID, and the client secret value
Configuring SSO in Milestone¶
SSO can be configured at two scopes:
Per-Organization (Multi-Tenant):
- In the admin portal, go to the Organizations tab
- Click the SSO configure button on the organization
- Enter:
- Client ID — Application (client) ID from Azure
- Tenant ID — Directory (tenant) ID from Azure
- Client Secret — The secret value
- Redirect URI —
https://your-domain.com/api/auth/sso/callback(the shared URL above) - Save configuration

All tenants in the organization share this SSO setup.
Per-Tenant (Multi-Tenant):
A tenant that does not belong to an organization can configure its own SSO from the SSO Configuration screen inside the application (admin only), using the same fields and the same shared redirect URI.
Organization SSO takes precedence
If a tenant belongs to an organization that has SSO enabled, the organization's configuration always applies and the tenant-level SSO form is shown read-only — a per-tenant configuration would be ignored. To configure SSO per tenant, remove the tenant from the organization (or disable the organization's SSO).

Per-Instance (Single-Tenant):
Configure SSO in the Settings modal within the application, or set environment variables:
SSO_ENABLED=true
SSO_CLIENT_ID=your-azure-app-client-id
SSO_CLIENT_SECRET=your-azure-app-client-secret
SSO_TENANT_ID=your-azure-tenant-id
SSO_REDIRECT_URI=https://your-domain.com/api/auth/sso/callback
SSO Login Flow¶
- User clicks Sign in with Microsoft on the login screen
- Redirected to Microsoft's login page
- After authentication, redirected back to Milestone with an authorization code
- Milestone exchanges the code for tokens and creates/updates the user session
- If the user doesn't exist in Milestone, their account is automatically created
Testing SSO¶
After saving the configuration, verify it end to end: open a tenant's login page and click
Sign in with Microsoft. You should be redirected to Microsoft, and after signing in,
returned to that tenant's workspace. If sign-in fails on the return trip, the most common
cause is a redirect-URI mismatch — confirm the App Registration, Milestone's Redirect
URI field, and (single-tenant) SSO_REDIRECT_URI all read exactly
https://your-domain.com/api/auth/sso/callback.
Group-Based Access Control¶
Restrict tenant access to users who belong to specific Microsoft Entra ID (Azure AD) security groups.
How It Works¶
- In the admin portal, edit a tenant
- Under Group Restrictions, add one or more Azure AD Group IDs (GUIDs from your Entra directory)
- Choose the membership mode:
- Any (default) — User must belong to at least one of the listed groups
- All — User must belong to every listed group
- Save the tenant configuration
When a user logs in via SSO, Milestone fetches their group memberships from the Microsoft Graph API and validates them against the tenant's requirements. If the user doesn't meet the group criteria, access is denied.
Finding Azure AD Group IDs¶
- Go to Azure Portal > Azure Active Directory > Groups
- Click on the group you want to use
- Copy the Object ID (a GUID like
a1b2c3d4-e5f6-7890-abcd-ef1234567890)
Use Cases¶
- Department isolation — Only R&D department members can access the R&D tenant
- Project-based access — Create an Azure AD group per project team and restrict the tenant accordingly
- Compliance — Ensure only authorized personnel can access sensitive project data
Note
Group-based access control requires SSO to be configured. It has no effect on local (email/password) authentication.