> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # SAML Canonical URL: https://posthog.com/docs/settings/authentication/saml ## On this page - [Prerequisites](#prerequisites) - [Configuring SAML](#configuring-saml) - [Warnings](#warnings) ###### Where is this feature available? ##### Free / Open-source ##### Paid ##### Boost ##### Scale ##### Enterprise ![Not available](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDIwIDIwIj48cGF0aCBmaWxsPSIjRkI0RjBEIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNjQyIDcuODE5Nkw0LjI0NDU5IDJMMiA0LjI0NDU5TDcuODE5NiAxMC4wNjQyTDIuMTI4MzcgMTUuNzU1NEw0LjM3Mjk2IDE4TDEwLjA2NDIgMTIuMzA4OEwxNS40Njc1IDE3LjcxMjFMMTcuNzEyMSAxNS40Njc1TDEyLjMwODggMTAuMDY0MkwxNy44NDA1IDQuNTMyNDhMMTUuNTk1OSAyLjI4Nzg5TDEwLjA2NDIgNy44MTk2WiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)![Not available](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDIwIDIwIj48cGF0aCBmaWxsPSIjRkI0RjBEIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC4wNjQyIDcuODE5Nkw0LjI0NDU5IDJMMiA0LjI0NDU5TDcuODE5NiAxMC4wNjQyTDIuMTI4MzcgMTUuNzU1NEw0LjM3Mjk2IDE4TDEwLjA2NDIgMTIuMzA4OEwxNS40Njc1IDE3LjcxMjFMMTcuNzEyMSAxN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NDIzMzggMjUuMDYzNCAzLjQyMzM4IDI1LjYxMDEgMy45NzAwOUwyNy41ODk5IDUuOTVDMjguMTM2NyA2LjQ5NjcxIDI4LjEzNjcgNy4zODMxNCAyNy41ODk5IDcuOTI5OUwxMS40ODk5IDI0LjAzQzEwLjk0MzIgMjQuNTc2NyAxMC4wNTY3IDI0LjU3NjcgOS41MTAwMyAyNC4wMjk5VjI0LjAyOTlaIi8+PC9zdmc+)![Available](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDI4IDI4Ij48cGF0aCBmaWxsPSIjNzFBQTU1IiBkPSJNOS41MTAwMyAyNC4wMjk5TDAuNDEwMDMzIDE0LjkyOTlDLTAuMTM2Njc4IDE0LjM4MzIgLTAuMTM2Njc4IDEzLjQ5NjggMC40MTAwMzMgMTIuOTVMMi4zODk4OCAxMC45NzAxQzIuOTM2NiAxMC40MjMzIDMuODIzMDggMTAuNDIzMyA0LjM2OTc5IDEwLjk3MDFMMTAuNSAxNy4xMDAyTDIzLjYzMDIgMy45NzAwOUMyNC4xNzY5IDMuNDIzMzggMjUuMDYzNCAzLjQyMzM4IDI1LjYxMDEgMy45NzAwOUwyNy41ODk5IDUuOTVDMjguMTM2NyA2LjQ5NjcxIDI4LjEzNjcgNy4zODMxNCAyNy41ODk5IDcuOTI5OUwxMS40ODk5IDI0LjAzQzEwLjk0MzIgMjQuNTc2NyAxMC4wNTY3IDI0LjU3NjcgOS41MTAwMyAyNC4wMjk5VjI0LjAyOTlaIi8+PC9zdmc+) Security Assertion Markup Language (SAML) enables users to access multiple systems with a single set of credentials. This is helpful for growing organizations that require centralized user management in an Identity Provider (IdP). If you are configuring IdP-based SSO for the first time, we recommend you use [OIDC](https://posthog.com/docs/settings/authentication/oidc.md), because it is [generally considered more secure](https://blog.trailofbits.com/2026/09/21/saml-a-fractal-of-bad-design/) and simpler to operate than SAML. ## Prerequisites 1. If you are using PostHog cloud, your organization must be subscribed to a platform package that offers SAML. If you are self-hosting PostHog, your instance must have an enterprise license that supports SAML. 2. You need to [verify domains](https://posthog.com/docs/settings/authentication/sso.md#authentication-domains) for any email address that you want to allow users to log in with. For example, if you want to allow users with an `@example.com` email address to log in, like `john@example.com`, you need to add and verify `example.com` as an authentication domain. 3. If you are self-hosting PostHog, make sure you have properly set up your `SITE_URL` [environment variable](https://posthog.com/docs/self-host/configure/environment-variables.md) configuration. 4. If you are self-hosting PostHog, your PostHog instance must be accessible from the public internet over TLS. ## Configuring SAML 1. Navigate to your organization's [authentication settings](https://app.posthog.com/settings/organization-authentication#setting=saml-configuration) page in PostHog. 2. Scroll down to the **SAML** section, and select **Configure**. 3. In your IdP, create a new SAML app for PostHog. a. Copy the "*ACS Consumer URL*", "*Audience / entity ID*", and "*Relay state*" displayed in PostHog into your SAML app's configuration in your IdP. b. Copy the following values from your SAML app's configuration in your IdP into PostHog: - **ACS URL** (also called **Sign-on URL** or **SAML endpoint**) - **Entity ID** (also called **Issuer**, **IdP issuer**, or **Azure AD Identifier**) - **X.509 certificate** used to verify SAML assertions Your IdP might provide these values in an XML metadata file. If the certificate is provided as a file, open it in a text editor and copy its contents without changing the spaces or line breaks. The `BEGIN CERTIFICATE` and `END CERTIFICATE` lines are optional. c. Verify that your IdP shares the following attributes in the SAML assertion with PostHog: | Attribute | Default name in PostHog | Optional? | | --- | --- | --- | | Permanent ID | `name_id` | ❌ No | | Email | `email` | ❌ No | | First (given) name | `first_name` | ❌ No | | Last name (surname) | `last_name` | ✅ Yes | 4. Select **Save**. ### Example: OneLogin #### OneLogin quick setup You can quickly connect OneLogin and PostHog by using the prebuilt integration. 1. In OneLogin admin, go to **Applications** and select **Add App**. ![OneLogin admin UI showing applications](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_25_onelogin_applications_584d48a954.png) 2. Search for "*PostHog*". Select the option that appears with that exact name, and which shows "*OneLogin, Inc.*" as the author. ![OneLogin admin UI showing application catalog](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_posthog_app_fd15be81ac.png) 3. Confirm the app details are correct, then select **Save**. ![OneLogin admin UI showing PostHog app details](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_posthog_app_details_a623da0d4d.png) 4. Navigate to the **Configuration** tab. In "*PostHog domain name*" enter the domain name you use to access PostHog. For example, if you use PostHog cloud, this will either be "*us.posthog.com*" or "*eu.posthog.com*". ![OneLogin admin UI showing a configuration field for the PostHog domain name](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_configuration_tab_b0ada5950e.png) 5. Navigate to your PostHog organization's [authentication settings](https://app.posthog.com/settings/organization-authentication#setting=saml-configuration), scroll down to **SAML**, then select **Configure**. ![PostHog UI showing authentication configurations](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_oidc_step_4_light_4a7b75e712.png) 6. In OneLogin admin, go to the **SSO** tab. a. Copy the *Issuer URL* from OneLogin into the *Entity ID* configuration field in PostHog. b. Copy the *SAML 2.0 Endpoint (HTTP)* from OneLogin into the *SAML ACS URL* configuration field in PostHog. c. On **X.509 Certificate** click on **View Details**. Copy the full certificate into the *SAML X.509 certificate* configuration field in PostHog. ![OneLogin admin UI showing SSO settings for the application](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_sso_tab_3166a73f59.png) 7. Select **Save configuration** in PostHog. ![PostHog UI showing SAML configuration](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_posthog_saml_configuration_light_6192b2052d.png) The next time you enter your email address during login, you will see an option to login using SAML. #### OneLogin advanced Use a custom SAML connector if you need app configurations that the prebuilt integration doesn't support. 1. In OneLogin admin, go to **Applications** and select **Add App**. ![OneLogin admin UI showing applications](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_25_onelogin_applications_584d48a954.png) 2. Search for "*SAML*" and select **SAML Custom Connector (Advanced)**. ![OneLogin admin UI showing application catalog](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_one_login_custom_saml_connector_search_2dedbb6f95.png) 3. Name the app "*PostHog*" and select **Save**. ![OneLogin admin UI showing application details form](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_saml_details_a9d2aa2a3c.png) 4. Navigate to the **Configuration** tab. Set the following fields, and leave everything else at its default value: a. Enter `https://us.posthog.com` in *Audience (EntityID)*. For the EU deployment, use `https://eu.posthog.com`. For a self-hosted instance, use the exact value of your `SITE_URL` [environment variable](https://posthog.com/docs/self-host/configure/environment-variables.md). b. Set *ACS (Consumer) URL Validator* to a regular expression that only matches `/complete/saml/`. For example, use `^https:\/\/us.posthog.com\/complete\/saml\/$` for the US deployment, or replace `us` with `eu` for the EU deployment. c. Enter `https://us.posthog.com/complete/saml/` in *ACS (Consumer) URL*. For the EU deployment, use `https://eu.posthog.com/complete/saml/`. For a self-hosted instance, use `/complete/saml/`. ![OneLogin admin UI showing configuration details](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_configuration_tab_a73810411b.png) 5. Navigate to the **Parameters** tab. Add the following parameters, and select **Include in SAML assertion** for each one: a. Map `email` to the user's *Email*. b. Map `first_name` to the user's *First Name*. c. Map `last_name` to the user's *Last Name*. ![OneLogin admin UI showing parameters details](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_parameters_tab_7107427191.png) 6. Navigate to your PostHog organization's [authentication settings](https://app.posthog.com/settings/organization-authentication#setting=saml-configuration), scroll down to **SAML**, then select **Configure**. ![PostHog UI showing authentication configurations](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_oidc_step_4_light_4a7b75e712.png) 7. In OneLogin admin, go to the **SSO** tab. a. Copy the *Issuer URL* from OneLogin into the *Entity ID* configuration field in PostHog. b. Copy the *SAML 2.0 Endpoint (HTTP)* from OneLogin into the *SAML ACS URL* configuration field in PostHog. c. On *X.509 Certificate*, select **View Details**. Copy the certificate without its first and last lines into the *SAML X.509 certificate* configuration field in PostHog. ![OneLogin admin UI showing sso details](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_custom_saml_sso_tab_2b98526c4b.png) 8. Select **Save configuration** in PostHog. ![PostHog UI showing SAML configuration](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_28_onelogin_custom_saml_configuration_light_8b91e30d3f.png) The next time you enter your email address during login, you will see an option to log in using SAML. ### Example: Okta 1. In Okta admin, go to **Applications** and select **Create App Integration**. ![Okta admin UI showing a Create App Integration button](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_1_3c4abb3562.png) 2. Select the **SAML 2.0** option for sign-in method. ![Okta admin UI showing a modal to configure an app integration](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_2_d3fae34823.png) 3. Select **Next**, name the configuration *PostHog*, then select **Next** again. ![Okta admin UI showing application form with a name field](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_3_d41495d5e5.png) 4. Navigate to your PostHog organization's [authentication settings](https://app.posthog.com/settings/organization-authentication#setting=saml-configuration), scroll down to **SAML**, then select **Configure**. ![PostHog UI showing authentication configurations](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_4_light_5657a92830.png) 5. Copy the *ACS consumer URL* from PostHog into the Okta app's *Single sign-on URL* field, and copy the *Audience / entity ID* from PostHog into the Okta app's *Audience URI (SP Entity ID)* field. ![Okta admin UI showing application form with single sign on url and audience uri fields](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_5_914ca0123f.png) 6. In Okta, select **Next**. Check the box that says *This is an internal app that we have created*, then select **Finish**. ![Okta admin UI showing application form with an internal app checkbox](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_6_0c1a394257.png) 7. Copy the *Sign on URL* from Okta to the *SAML ACS URL* field in PostHog, the *Issuer* from Okta to the *SAML entity ID* field in PostHog, and the *Signing Certificate* from Okta to the *SAML X.509 certificate* field in PostHog. ![Okta admin UI showing SAML details](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_7_bf9659ed8d.png) 8. Select **Save configuration** in PostHog. ![PostHog UI showing SAML settings form](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_8_light_c9de006770.png) 9. In Okta, navigate to the Sign On tab of your SAML app, then select **Edit** in the **Settings** section. ![Okta admin UI showing application single sign on tab](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_9_7c370ffb69.png) 10. Copy the *Relay state* from PostHog to the *Default Relay State* field in Okta. Select **Save** ![Okta admin UI showing application form with default relay state field](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_10_225870e4a8.png) 11. In Okta, scroll down to **Attribute Statements** add the following statements: | Name | Expression | | --- | --- | | email | user.profile.email | | first\_name | user.profile.firstName | | last\_name | user.profile.lastName | ![Okta admin UI showing SAML assertions](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/2026_09_17_okta_saml_step_11_3e259c5ae8.png) The next time you enter your email address during login, you will see an option to login using SAML. ## Warnings When using SAML to authenticate users in PostHog, there are a few considerations to keep in mind: 1. **Only use SAML with identity providers you trust and that verify the user's email address.** During login we use the email address provided by the identity provider. An untrusted identity provider could spoof a user's email address to impersonate your users. 2. Enabling or enforcing **SAML will not disable Personal API Key usage**. Users can authenticate with the PostHog API using their API keys without first authenticating via SAML. You can use [ID-JAG (XAA)](https://posthog.com/docs/settings/authentication/id-jag.md) to programmatically restrict API access using policies defined in your identity provider. 3. Our SAML integration only handles authentication and user provisioning. It does not handle user removal. You can use [SCIM](https://posthog.com/docs/settings/authentication/scim.md) to automatically deprovision users. 4. When you enable or enforce SAML, any existing user passwords are saved. If you disable SAML SSO in the future, your users will be able to login using their pre-existing password credentials.