SAML authentication
Zulip supports SAML single sign-on. SAML Single Logout is available when configured on both the server and identity provider.
This page describes how to configure SAML authentication with several common providers:
- Okta
- OneLogin
- Entra ID (AzureAD)
- Keycloak
- Auth0
Other SAML providers are supported as well.
Your server operator must configure the authentication backend using the SAML server configuration documentation. Obtain the exact SP Entity ID, ACS URL, SP metadata, and signing requirements from the operator. These depend on your server configuration and may differ from the organization’s main website address. Provider field names below refer to their English UI; the locations can vary by provider version.
<sp-entity-id> and <acs-url> are placeholders for those operator-supplied
values. Replace them before saving settings or JSON. Attribute names and
mappings must match the server’s IdP configuration.
Configure SAML
Section titled “Configure SAML”- Set up SAML authentication by following
Okta’s documentation.
Specify the following fields, skipping Default RelayState and Name ID format:
- Single sign on URL:
<acs-url> - Audience URI (SP Entity ID):
<sp-entity-id> - Application username format:
Email - Attribute statements:
emailtouser.emailfirst_nametouser.firstNamelast_nametouser.lastName
- Single sign on URL:
- Assign the appropriate accounts in the Assignments tab. These are the users that will be able to log in to your Zulip organization.
-
Provide your operator with the following information so they can finish the server configuration:
- Your organization’s URL
- The Identity Provider metadata provided by Okta for the application. To get the data, click the View SAML setup instructions button in the right sidebar in the Sign on tab. Copy the IdP metadata shown at the bottom of the page.
- Your preferred label for the login button, for example “Log in with…”
- (optional) An icon for the login button
- Navigate to the OneLogin Applications page, and click Add App.
- Search for the SAML Custom Connector (Advanced) app and select it.
- Set a name and logo and click Save. This doesn’t affect anything in Zulip, but will be shown on your OneLogin Applications page.
- In the Configuration section, specify the following fields. Leave the
remaining fields as they are, including blank fields.
- Audience:
<sp-entity-id> - Recipient:
<acs-url> - ACS URL:
<acs-url> - ACS URL Validator:
<acs-url-regex>— an anchored regular expression matching only the operator-provided ACS URL, with regex metacharacters escaped
- Audience:
- In the Parameters section, add the following custom parameters. Set the
Include in SAML assertion flag on each parameter.
Field name Value email Email first_name First Name last_name Last Name username Email -
Provide your operator with the following information so they can finish the server configuration:
- Your organization’s URL
- The issuer URL from the SSO section. It contains required Identity Provider metadata.
- Your preferred label for the login button, for example “Log in with…”
- (optional) An icon for the login button
- From your Entra ID Dashboard, navigate to Enterprise applications, click New application, followed by Create your own application.
- Enter a name (e.g.,
Organization SAML) for the new Entra ID application, choose Integrate any other application you don’t find in the gallery (Non-gallery), and click Create. - From your new Entra ID application’s Overview page that opens, go to Single sign-on, and select SAML.
- In the Basic SAML Configuration section, specify the following fields:
- Identifier (Entity ID):
<sp-entity-id> - Default: checked (This is required for enabling IdP-initiated sign on.)
- Reply URL (Assertion Consumer Service URL):
<acs-url>
- Identifier (Entity ID):
- If you want to set up IdP-initiated sign on, in the Basic SAML
Configuration section, also specify:
- RelayState:
{"subdomain": "<organization-id>"}. Ask your operator for the organization identifier; for the root organization it may be empty. A single-organization deployment may not need custom RelayState.
- RelayState:
- Check the User Attributes & Claims configuration, which should already be
set to the following. If the configuration is different, please
agree the claim mappings with your operator
(see next step).
- givenname:
user.givenname - surname:
user.surname - emailaddress:
user.mail - name:
user.principalname - Unique User Identifier:
user.principalname
- givenname:
-
Provide your operator with the following information so they can finish the server configuration:
- Your organization’s URL
- From the SAML Signing Certificate section:
- App Federation Metadata Url
- Certificate downloaded from Certificate (Base64)
- From the Set up section
- Login URL
- Microsoft Entra Identifier
- Your preferred label for the login button, for example “Log in with…”
- (optional) An icon for the login button
- Make sure your Keycloak server is up and running.
- In Keycloak, register a new Client for your Zulip organization:
- Client-ID:
<sp-entity-id> - Client type/protocol:
saml - Client SAML Endpoint: (empty)
- Client-ID:
- In the Settings tab for your new Keycloak client, set the following properties:
- Valid Redirect URIs:
<acs-url> - Assertion Consumer Service POST Binding URL (in advanced endpoint settings):
<acs-url> - Client Signature Required: match the SP signing configuration agreed with your operator. If the server signs requests, enable this requirement and import or retrieve the SP public certificate from its metadata. Configure logout endpoints separately from the ACS when Single Logout is used.
- Valid Redirect URIs:
- In the Mappers tab for your new Keycloak client:
- Create a Mapper for the first name:
- Property:
firstName - Friendly Name:
first_name - SAML Attribute Name:
first_name - SAML Attribute Name Format:
Basic
- Property:
- Create a Mapper for the last name:
- Property:
lastName - Friendly Name:
last_name - SAML Attribute Name:
last_name - SAML Attribute Name Format:
Basic
- Property:
- Create a Mapper for the email address:
- Property:
email - Friendly Name:
email - SAML Attribute Name:
email - SAML Attribute Name Format:
Basic
- Property:
- Create a Mapper for the first name:
-
Provide your operator with the following information so they can finish the server configuration:
- Your organization’s URL
- The URL of your Keycloak realm.
- Your preferred label for the login button, for example “Log in with…”
- (optional) An icon for the login button
- Set up SAML authentication by following Auth0’s documentation to create a new application. Give the operator the SAML Metadata URL so they can configure the IdP certificate and endpoints on the server.
- In the Addon: SAML2 Web App Settings tab, set the Application Callback URL to
<acs-url>. - Edit the Settings section to match:
{"audience": "<sp-entity-id>","mappings": {"email": "email","given_name": "first_name","family_name": "last_name"},"binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"}
-
Provide your operator with the following information so they can finish the server configuration:
- Your organization’s URL
- The SAML Metadata URL value mentioned above. It contains required Identity Provider metadata.
- Your preferred label for the login button, for example “Log in with…”
- (optional) An icon for the login button
Synchronizing group membership with SAML
Section titled “Synchronizing group membership with SAML”You can configure each Zulip user’s groups to be updated based on their groups in your Identity Provider’s (IdP’s) directory every time they log in.
Your IdP directory’s group names don’t have to match the associated Zulip group names (e.g., membership in your IdP’s group finance can be synced to membership in the Zulip group finance-department). See the technical documentation on how your IdP’s groups are mapped to Zulip groups for details.
- Follow the instructions above to configure SAML, and go to the application you created for using SAML with Zulip in your Applications menu.
- Select the General tab, and Edit the SAML Settings section.
- Proceed through the prompts until the main Configure SAML prompt.
- Scroll down below the Attribute Statements section (which you configured when creating the app) to Group Attribute Statements.
- Add the following attribute:
- Name:
zulip_groups - Name format:
Unspecified - Filter:
Matches regex: .*When a user signs in to Zulip via SAML, Okta will now include a list of the user’s groups in its response to the Zulip server.
- Name:
- To enable this feature, send your operator the following information:
- Your Zulip organization URL.
- Which groups should be synced from your IdP’s directory.
- Which groups should have a different name in Zulip (if any).
Verify sign-in
Section titled “Verify sign-in”- Ask the operator to finish the server configuration using the supplied IdP metadata, certificate, and attribute mappings.
- Test sign-in from the organization’s login page with an assigned test user. Confirm the correct organization, email, and name.
- If IdP-initiated login is enabled, test it separately from the provider’s application portal. Confirm RelayState selects the intended organization.
- If group sync is enabled, check the mapped group membership after a new login. SAML changes group membership at login; use SCIM for ongoing provisioning and deactivation.
- If Single Logout is configured, check it with the operator. Ordinary application logout alone does not confirm the provider session ended.