<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure SAML authentication in Grafana on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/</link><description>Recent content in Configure SAML authentication in Grafana on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure SAML authentication using the Grafana configuration file</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-file/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-file/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-authentication-using-the-grafana-configuration-file&#34;&gt;Configure SAML authentication using the Grafana configuration file&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Available in 
    &lt;a href=&#34;/docs/grafana/v12.4/introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt; and &lt;a href=&#34;/docs/grafana-cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/&#34;&gt;Configuration&lt;/a&gt; for more information about configuring Grafana.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To configure SAML authentication in Grafana using the configuration file, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the &lt;code&gt;[auth.saml]&lt;/code&gt; section in the Grafana configuration file, set 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#enabled-3&#34;&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure SAML according to your requirements. &lt;strong&gt;Review all the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-configuration-options/&#34;&gt;available configuration options&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;For IdP-specific configuration, refer to:
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-okta/&#34;&gt;Configure SAML with Okta&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-azuread/&#34;&gt;Configure SAML with Entra ID&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save the configuration file and then restart the Grafana server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here&amp;rsquo;s an example of a Grafana configuration file with SAML:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[server]
root_url = https://grafana.example.com

[auth.saml]
enabled = true
name = My IdP
auto_login = false
private_key_path = &amp;#34;/path/to/private_key.pem&amp;#34;
certificate_path = &amp;#34;/path/to/certificate.cert&amp;#34;
idp_metadata_url = &amp;#34;https://my-org.okta.com/app/my-application/sso/saml/metadata&amp;#34;
assertion_attribute_name = DisplayName
assertion_attribute_login = Login
assertion_attribute_email = Email
assertion_attribute_groups = Group&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;saml-name-id&#34;&gt;SAML Name ID&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;name_id_format&lt;/code&gt; configuration field specifies the requested format of the NameID element in the SAML assertion.&lt;/p&gt;
&lt;p&gt;By default, this is set to &lt;code&gt;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&lt;/code&gt; and does not need to be specified in the configuration file.&lt;/p&gt;
&lt;p&gt;The following list includes valid configuration field values:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;code&gt;name_id_format&lt;/code&gt; value in the configuration file or Terraform&lt;/th&gt;
              &lt;th&gt;&lt;code&gt;Name identifier format&lt;/code&gt; on the UI&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Default&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Unspecified&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Email address&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:2.0:nameid-format:persistent&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Persistent&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Transient&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;maximum-issue-delay&#34;&gt;Maximum issue delay&lt;/h2&gt;
&lt;p&gt;Prevents SAML response replay attacks and internal clock skews between the SP (Grafana) and the IdP. You can set a maximum amount of time between the SP issuing the AuthnRequest and the SP (Grafana) processing it.&lt;/p&gt;
&lt;p&gt;The configuration options is specified as a duration, such as &lt;code&gt;max_issue_delay = 90s&lt;/code&gt; or &lt;code&gt;max_issue_delay = 1h&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;metadata-valid-duration&#34;&gt;Metadata valid duration&lt;/h2&gt;
&lt;p&gt;SP metadata is likely to expire at some point, perhaps due to a certificate rotation or change of location binding. Grafana allows you to specify for how long the metadata should be valid. Leveraging the &lt;code&gt;validUntil&lt;/code&gt; field, you can tell consumers until when your metadata is going to be valid. The duration is computed by adding the duration to the current time.&lt;/p&gt;
&lt;p&gt;The configuration option is specified as a duration, such as &lt;code&gt;metadata_valid_duration = 48h&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;allow-new-user-sign-up&#34;&gt;Allow new user sign up&lt;/h2&gt;
&lt;p&gt;By default, new Grafana users using SAML authentication will have an account created for them automatically. To decouple authentication and account creation and ensure only users with existing accounts can log in with SAML, set the &lt;code&gt;allow_sign_up&lt;/code&gt; option to false.&lt;/p&gt;
&lt;h2 id=&#34;configure-automatic-login&#34;&gt;Configure automatic login&lt;/h2&gt;
&lt;p&gt;Set &lt;code&gt;auto_login&lt;/code&gt; option to true to attempt login automatically, skipping the login screen.
This setting is ignored if multiple auth providers are configured to use auto login.&lt;/p&gt;
&lt;p&gt;For more information about automatic login behavior and troubleshooting, see 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/#automatic-oauth-login&#34;&gt;Automatic login&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;auto_login = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-allowed-organizations&#34;&gt;Configure allowed organizations&lt;/h2&gt;
&lt;p&gt;With the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#allowed_organizations&#34;&gt;&lt;code&gt;allowed_organizations&lt;/code&gt;&lt;/a&gt; option you can specify a list of organizations where the user must be a member of at least one of them to be able to log in to Grafana.&lt;/p&gt;
&lt;p&gt;To get the list of user&amp;rsquo;s organizations from SAML attributes, you must configure the &lt;code&gt;assertion_attribute_org&lt;/code&gt; option. This option specifies which SAML attribute contains the list of organizations the user belongs to.&lt;/p&gt;
&lt;p&gt;To put values containing spaces in the list, use the following JSON syntax:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;allowed_organizations = [&amp;#34;org 1&amp;#34;, &amp;#34;second org&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configuring-saml-with-http-post-binding&#34;&gt;Configuring SAML with HTTP-Post binding&lt;/h2&gt;
&lt;p&gt;If multiple bindings are supported for SAML Single Sign-On (SSO) by the Identity Provider (IdP), Grafana will use the &lt;code&gt;HTTP-Redirect&lt;/code&gt; binding by default. If the IdP only supports the &lt;code&gt;HTTP-Post binding&lt;/code&gt; then updating the &lt;code&gt;content_security_policy_template&lt;/code&gt; (in case &lt;code&gt;content_security_policy = true&lt;/code&gt;) and &lt;code&gt;content_security_policy_report_only_template&lt;/code&gt; (in case &lt;code&gt;content_security_policy_report_only = true&lt;/code&gt;) might be required to allow Grafana to initiate a POST request to the IdP. These settings are used to define the &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Content Security Policy (CSP)&lt;/a&gt; headers that are sent by Grafana.&lt;/p&gt;
&lt;p&gt;To allow Grafana to initiate a POST request to the IdP, update the &lt;code&gt;content_security_policy_template&lt;/code&gt; and &lt;code&gt;content_security_policy_report_only_template&lt;/code&gt; settings in the Grafana configuration file and add the identity provider domain to the &lt;code&gt;form-action&lt;/code&gt; directive. By default, the &lt;code&gt;form-action&lt;/code&gt; directive is set to &lt;code&gt;self&lt;/code&gt; which only allows POST requests to the same domain as Grafana. To allow POST requests to the identity provider domain, update the &lt;code&gt;form-action&lt;/code&gt; directive to include the identity provider domain, for example: &lt;code&gt;form-action &#39;self&#39; https://idp.example.com&lt;/code&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;For Grafana Cloud instances, please contact Grafana Support to update the &lt;code&gt;content_security_policy_template&lt;/code&gt; and &lt;code&gt;content_security_policy_report_only_template&lt;/code&gt; settings of your Grafana instance. Please provide the metadata URL/file of your IdP.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;idp-initiated-single-sign-on-sso&#34;&gt;IdP-initiated Single Sign-On (SSO)&lt;/h2&gt;
&lt;p&gt;By default, Grafana allows only service provider (SP) initiated logins (when the user logs in with SAML via the login page in Grafana). If you want users to log in into Grafana directly from your identity provider (IdP), set the &lt;code&gt;allow_idp_initiated&lt;/code&gt; configuration option to &lt;code&gt;true&lt;/code&gt; and configure &lt;code&gt;relay_state&lt;/code&gt; with the same value specified in the IdP configuration.&lt;/p&gt;
&lt;p&gt;IdP-initiated SSO has some security risks, so make sure you understand the risks before enabling this feature. When using IdP-initiated login, Grafana receives unsolicited SAML responses and can&amp;rsquo;t verify that login flow was started by the user. This makes it hard to detect whether SAML message has been stolen or replaced. Because of this, IdP-initiated login is vulnerable to login cross-site request forgery (CSRF) and man in the middle (MITM) attacks. We do not recommend using IdP-initiated login and keeping it disabled whenever possible.&lt;/p&gt;
&lt;h2 id=&#34;assertion-mapping&#34;&gt;Assertion mapping&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;assertion_attribute_name&lt;/code&gt; is a special assertion mapping that can either be a simple key, indicating a mapping to a single assertion attribute on the SAML response, or a complex template with variables using the &lt;code&gt;$__saml{&amp;lt;attribute&amp;gt;}&lt;/code&gt; syntax. If this property is misconfigured, Grafana will log an error message on startup and disallow SAML sign-ins. Grafana will also log errors after a login attempt if a variable in the template is missing from the SAML response.&lt;/p&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/#assertion-mapping&#34;&gt;Assertion mapping&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;#plain string mapping
assertion_attribute_name = displayName&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;#template mapping
assertion_attribute_name = $__saml{firstName} $__saml{lastName}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-saml-authentication-using-the-grafana-configuration-file">Configure SAML authentication using the Grafana configuration file&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Available in
&lt;a href="/docs/grafana/v12.4/introduction/grafana-enterprise/">Grafana Enterprise&lt;/a> and &lt;a href="/docs/grafana-cloud/">Grafana Cloud&lt;/a>.&lt;/p>
&lt;p>Refer to
&lt;a href="/docs/grafana/v12.4/setup-grafana/configure-grafana/">Configuration&lt;/a> for more information about configuring Grafana.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>To configure SAML authentication in Grafana using the configuration file, follow these steps:&lt;/p></description></item><item><title>Configure SAML authentication using the Grafana user interface</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-ui/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-ui/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-authentication-using-the-grafana-user-interface&#34;&gt;Configure SAML authentication using the Grafana user interface&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Available in 
    &lt;a href=&#34;/docs/grafana/v12.4/introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt; version 10.0 and later, and to customers on select Grafana Cloud plans. For pricing information, visit &lt;a href=&#34;/pricing/&#34;&gt;Pricing&lt;/a&gt; or contact our sales team.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;You can configure SAML authentication in Grafana using the configuration file, Terraform, the API, or the UI. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/#set-up-options-for-saml-authentication-in-grafana&#34;&gt;Set up options for SAML authentication in Grafana&lt;/a&gt; for more details. Configuration in the API or UI takes precedence over the configuration in the Grafana configuration file. For more information on how Grafana determines the order of precedence for its settings, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/developers/http_api/sso-settings/&#34;&gt;SSO Settings API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Grafana SAML UI provides the following advantages over configuring SAML in the Grafana configuration file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It&amp;rsquo;s accessible by Grafana Cloud users.&lt;/li&gt;
&lt;li&gt;Access to the SAML UI only requires access to authentication settings, so users with limited access to the Grafana configuration can use it.&lt;/li&gt;
&lt;li&gt;The SAML UI carries out input validation and gives feedback on whether the configuration works, making SAML setup easier.&lt;/li&gt;
&lt;li&gt;It doesn&amp;rsquo;t require Grafana to be restarted after a configuration update.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To configure SAML authentication from the UI, sign in to Grafana and navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; Configure SAML&lt;/strong&gt; and follow this document.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To follow this guide, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Knowledge of SAML authentication. Refer to &lt;a href=&#34;../&#34;&gt;SAML authentication in Grafana&lt;/a&gt; for an overview of the SAML integration in Grafana.&lt;/li&gt;
&lt;li&gt;Permissions &lt;code&gt;settings:read&lt;/code&gt; and &lt;code&gt;settings:write&lt;/code&gt; with scope &lt;code&gt;settings:auth.saml:*&lt;/code&gt; that allow you to read and update SAML authentication settings, which are granted by &lt;code&gt;fixed:authentication.config:writer&lt;/code&gt; role. By default, this role is granted to Grafana server administrator in self-hosted instances and to Organization admins in Grafana Cloud instances.&lt;/li&gt;
&lt;li&gt;A Grafana instance running Grafana version 10.0 or later with 
    &lt;a href=&#34;/docs/grafana/v12.4/introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;, or a select Grafana Cloud account.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;general-settings&#34;&gt;General Settings&lt;/h2&gt;
&lt;p&gt;Complete the &lt;strong&gt;General settings&lt;/strong&gt; fields:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Allow signup:&lt;/strong&gt; If enabled, you can create users through SAML login. If it&amp;rsquo;s disabled, only existing Grafana users can log in with SAML.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto login:&lt;/strong&gt; If enabled, Grafana automatically logs in with SAML, skipping the login screen.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single logout:&lt;/strong&gt; The SAML single logout feature enables users to log out from all applications associated with the current IdP session established using SAML SSO. For more information, refer to &lt;a href=&#34;../configure-saml-single-logout&#34;&gt;SAML single logout documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identity provider initiated login:&lt;/strong&gt; Enables users to log in to Grafana directly from the SAML IdP. For more information, refer to &lt;a href=&#34;../#idp-initiated-single-sign-on-sso&#34;&gt;IdP initiated login documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;sign-requests&#34;&gt;Sign Requests&lt;/h2&gt;
&lt;p&gt;Toggle &lt;strong&gt;Sign requests&lt;/strong&gt; to specify whether you want the outgoing requests to be signed. Although optional, requesting signatures provides a more secure approach to SAML.&lt;/p&gt;
&lt;p&gt;If you select to sign them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Provide a certificate and a private key that&amp;rsquo;ll be used by the service provider (Grafana) and the SAML IdP.&lt;/p&gt;
&lt;p&gt;Use the &lt;a href=&#34;https://en.wikipedia.org/wiki/PKCS_8&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PKCS #8&lt;/a&gt; format to issue the private key.&lt;/p&gt;
&lt;p&gt;For more information, refer to an &lt;a href=&#34;../configure-saml-signing-encryption/#example-of-private-key-generation-for-saml-authentication&#34;&gt;example on how to generate SAML credentials&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, you can generate a new private key and certificate pair directly from the UI. Click the &lt;code&gt;Generate key and certificate&lt;/code&gt; button to open a form where you provide information to embed in the new certificate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose which signature algorithm to use. The SAML standard recommends using a digital signature for some types of messages, like authentication or logout requests to avoid &lt;a href=&#34;https://en.wikipedia.org/wiki/Man-in-the-middle_attack&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;man-in-the-middle attacks&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;connect-grafana-with-the-identity-provider&#34;&gt;Connect Grafana with the Identity Provider&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You can skip this screen.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Configure IdP using Grafana metadata:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Copy the &lt;strong&gt;Metadata URL&lt;/strong&gt; and provide it to your SAML IdP to establish a connection between Grafana and the IdP. The metadata URL contains the necessary information for the IdP to establish a connection with Grafana.&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;Assertion Consumer Service URL&lt;/strong&gt; and provide it to your SAML IdP. The Assertion Consumer Service URL is the endpoint where the IdP sends the SAML assertion after the user has been authenticated.&lt;/li&gt;
&lt;li&gt;If you want to use the &lt;strong&gt;Single Logout&lt;/strong&gt; feature, copy the &lt;strong&gt;Single Logout Service URL&lt;/strong&gt; and provide it to your SAML IdP.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finish configuring Grafana using IdP data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The metadata contains the necessary information for Grafana to establish a connection with the IdP.&lt;/li&gt;
&lt;li&gt;This can be provided as Base64-encoded value, a path to a file, or as a URL.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;user-mapping&#34;&gt;User Mapping&lt;/h2&gt;
&lt;h3 id=&#34;assertion-mapping&#34;&gt;Assertion mapping&lt;/h3&gt;
&lt;p&gt;If you want to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/#assertion-mapping&#34;&gt;map user information from SAML assertions&lt;/a&gt;, complete the &lt;strong&gt;Assertion attributes mappings&lt;/strong&gt; section.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To use team sync you need to configure the &lt;strong&gt;Groups attribute&lt;/strong&gt; field. Team sync automatically maps users to Grafana teams based on their SAML group membership. Learn more about &lt;a href=&#34;../../../configure-team-sync&#34;&gt;team sync&lt;/a&gt; and &lt;a href=&#34;../configure-saml-team-role-mapping/#configure-team-sync&#34;&gt;configuring team sync for SAML&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;role-mapping&#34;&gt;Role mapping&lt;/h3&gt;
&lt;p&gt;If you want to automatically assign users&amp;rsquo; roles based on their SAML roles, complete the &lt;strong&gt;Role mapping&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;First, you need to configure the &lt;strong&gt;Role attribute&lt;/strong&gt; field to specify which SAML attribute should be used to retrieve SAML role information. Then enter the SAML roles that you want to map to Grafana roles in &lt;strong&gt;Role mapping&lt;/strong&gt; section. If you want to map multiple SAML roles to a Grafana role, separate them by a comma and a space. For example, &lt;code&gt;Editor: editor, developer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Role mapping automatically updates user&amp;rsquo;s &lt;a href=&#34;../../../../../administration/roles-and-permissions/access-control/#basic-roles&#34;&gt;basic role&lt;/a&gt; based on their SAML roles every time the user logs in to Grafana. Learn more about &lt;a href=&#34;../configure-saml-team-role-mapping/#configure-role-sync&#34;&gt;SAML role synchronization&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;mapping-with-entra-id&#34;&gt;Mapping with Entra ID&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re using Entra ID as the Identity Provider over SAML, keep in mind Azure&amp;rsquo;s interpretation of these attributes. Enter the full URLs in the corresponding fields within the UI, which should match the URLs from the metadata XML. There are differences depending on whether it&amp;rsquo;s a Role or Group claim vs other assertions which Microsoft has &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/reference-claims-customization#table-2-saml-restricted-claim-set&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;documented&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Group and Role:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;http://schemas.microsoft.com/ws/2008/06/identity/claims/role
http://schemas.microsoft.com/ws/2008/06/identity/claims/groups
http://schemas.microsoft.com/identity/claims/displayname&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Other assertions:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://github.com/user-attachments/assets/23910ab8-20ec-4dfd-8ef6-7dbaec51ac90&#34;
  alt=&#34;image&#34;/&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re setting up Grafana with Entra ID using the SAML protocol and want to fetch user groups from the Graph API, complete the &lt;strong&gt;Entra ID Service Account Configuration&lt;/strong&gt; subsection.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set up a service account in Entra ID and provide the necessary details in the &lt;strong&gt;Entra ID Service Account Configuration&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Provide the &lt;strong&gt;Client ID&lt;/strong&gt; of your Entra ID application.&lt;/li&gt;
&lt;li&gt;Provide the &lt;strong&gt;Client Secret&lt;/strong&gt; of your Entra ID application, the &lt;strong&gt;Client Secret&lt;/strong&gt; will be used to request an access token from Entra ID.&lt;/li&gt;
&lt;li&gt;Provide the Entra ID request &lt;strong&gt;Access Token URL&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you don&amp;rsquo;t have users with more than 150 groups, you can still force the use of the Graph API by enabling the &lt;strong&gt;Force use Graph API&lt;/strong&gt; toggle.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;mapping-organizations&#34;&gt;Mapping organizations&lt;/h3&gt;
&lt;p&gt;If you have multiple organizations and want to automatically add users to organizations, complete the &lt;strong&gt;Org mapping section&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;First, you need to configure the &lt;strong&gt;Org attribute&lt;/strong&gt; field to specify which SAML attribute should be used to retrieve SAML organization information.
Now fill in the &lt;strong&gt;Org mapping&lt;/strong&gt; field with mappings from SAML organization to Grafana organization. For example, &lt;code&gt;Org mapping: Engineering:2, Sales:2&lt;/code&gt; will map users who belong to &lt;code&gt;Engineering&lt;/code&gt; or &lt;code&gt;Sales&lt;/code&gt; organizations in SAML to Grafana organization with ID 2.
If you want users to have different roles in different organizations, you can additionally specify a role. For example, &lt;code&gt;Org mapping: Engineering:2:Editor&lt;/code&gt; will map users who belong to &lt;code&gt;Engineering&lt;/code&gt; organizations in SAML to Grafana organization with ID 2 and assign them Editor role.&lt;/p&gt;
&lt;p&gt;Organization mapping automatically updates user&amp;rsquo;s organization memberships (and roles, if they&amp;rsquo;ve been configured) based on their SAML organization every time the user logs in to Grafana. Learn more about &lt;a href=&#34;../configure-saml-org-mapping/&#34;&gt;SAML organization mapping&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want to limit the access to Grafana based on user&amp;rsquo;s SAML organization membership, fill in the &lt;strong&gt;Allowed organizations&lt;/strong&gt; field.&lt;/p&gt;
&lt;h2 id=&#34;test-and-enable&#34;&gt;Test And Enable&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Save and enable&lt;/strong&gt;. If there are issues with your configuration, an error message will appear. Refer back to the previous steps to correct the issues and click on &lt;code&gt;Save and apply&lt;/code&gt; on the top right corner once you are done.&lt;/li&gt;
&lt;li&gt;If there are no configuration issues, the SAML integration status will change to &lt;code&gt;Enabled&lt;/code&gt;. Your SAML configuration is now enabled.&lt;/li&gt;
&lt;li&gt;To disable SAML integration, click &lt;code&gt;Disable&lt;/code&gt; in the top right corner.&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="configure-saml-authentication-using-the-grafana-user-interface">Configure SAML authentication using the Grafana user interface&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Available in
&lt;a href="/docs/grafana/v12.4/introduction/grafana-enterprise/">Grafana Enterprise&lt;/a> version 10.0 and later, and to customers on select Grafana Cloud plans. For pricing information, visit &lt;a href="/pricing/">Pricing&lt;/a> or contact our sales team.&lt;/p></description></item><item><title>SAML configuration options</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-configuration-options/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-configuration-options/</guid><content><![CDATA[&lt;h1 id=&#34;saml-configuration-options&#34;&gt;SAML configuration options&lt;/h1&gt;
&lt;p&gt;This page provides a comprehensive guide to configuring SAML authentication in Grafana. You&amp;rsquo;ll find detailed configuration examples, available settings, and their descriptions to help you set up and customize SAML authentication for your Grafana instance.&lt;/p&gt;
&lt;p&gt;The table below describes all SAML configuration options. Continue reading below for details on specific options. Like any other Grafana configuration, you can apply these options as 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#override-configuration-with-environment-variables&#34;&gt;environment variables&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Required&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether SAML authentication is allowed.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Name used to refer to the SAML authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;SAML&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;entity_id&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The entity ID of the service provider. This is the unique identifier of the service provider.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://{Grafana URL}/saml/metadata&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;single_logout&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether SAML Single Logout is enabled.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allow_sign_up&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether to allow new Grafana user creation through SAML login. If set to &lt;code&gt;false&lt;/code&gt;, then only existing Grafana users can log in with SAML.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auto_login&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether SAML auto login is enabled.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allow_idp_initiated&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether SAML IdP-initiated login is allowed.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;certificate&lt;/code&gt; or &lt;code&gt;certificate_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Base64-encoded string or Path for the SP X.509 certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;private_key&lt;/code&gt; or &lt;code&gt;private_key_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Base64-encoded string or Path for the SP private key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signature_algorithm&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Signature algorithm used for signing requests to the IdP. Supported values are rsa-sha1, rsa-sha256, rsa-sha512.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;idp_metadata&lt;/code&gt;, &lt;code&gt;idp_metadata_path&lt;/code&gt;, or &lt;code&gt;idp_metadata_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Base64-encoded string, Path or URL for the IdP SAML metadata XML.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;max_issue_delay&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Maximum time allowed between the issuance of an AuthnRequest by the SP and the processing of the Response.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;90s&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;metadata_valid_duration&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Duration for which the SP metadata remains valid.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;48h&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;relay_state&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Relay state for IdP-initiated login. This should match the relay state configured in the IdP.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user name. Alternatively, this can be a template with variables that match the names of attributes within the SAML assertion.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;displayName&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_login&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user login handle.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;mail&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_email&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user email.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;mail&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user groups.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_role&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user roles.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_org&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user organization&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_external_uid&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Friendly name or name of the attribute within the SAML assertion to use as the user external UID.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;userUID&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_organizations&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated organizations. User should be a member of at least one organization to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;org_mapping&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated Organization:OrgId:Role mappings. Organization can be &lt;code&gt;*&lt;/code&gt; meaning &amp;ldquo;All users&amp;rdquo;. Role is optional and can have the following values: &lt;code&gt;None&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt; or &lt;code&gt;Admin&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_values_none&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated roles which will be mapped into the None role.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_values_viewer&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated roles which will be mapped into the Viewer role.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_values_editor&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated roles which will be mapped into the Editor role.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_values_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated roles which will be mapped into the Admin role.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_values_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated roles which will be mapped into the Grafana Admin (Super Admin) role.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;skip_org_role_sync&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether to skip organization role synchronization.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name_id_format&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Specifies the format of the requested NameID element in the SAML AuthnRequest.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_id&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Client ID of the IdP service application used to retrieve more information about the user from the IdP. (Microsoft Entra ID only)&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_secret&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Client secret of the IdP service application used to retrieve more information about the user from the IdP. (Microsoft Entra ID only)&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;token_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;URL to retrieve the access token from the IdP. (Microsoft Entra ID only)&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;force_use_graph_api&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Whether to use the IdP service application retrieve more information about the user from the IdP. (Microsoft Entra ID only)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;example-saml-configuration&#34;&gt;Example SAML configuration&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
enabled = true
auto_login = false
certificate_path = &amp;#34;/path/to/certificate.cert&amp;#34;
private_key_path = &amp;#34;/path/to/private_key.pem&amp;#34;
idp_metadata_path = &amp;#34;/my/metadata.xml&amp;#34;
max_issue_delay = 90s
metadata_valid_duration = 48h
assertion_attribute_name = displayName
assertion_attribute_login = mail
assertion_attribute_email = mail

assertion_attribute_groups = Group
assertion_attribute_role = Role
assertion_attribute_org = Org
role_values_viewer = external
role_values_editor = editor, developer
role_values_admin = admin, operator
role_values_grafana_admin = superadmin
org_mapping = Engineering:2:Editor, Engineering:3:Viewer, Sales:3:Editor, *:1:Editor
allowed_organizations = Engineering, Sales&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;example-saml-configuration-in-terraform&#34;&gt;Example SAML configuration in Terraform&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;terraform&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-terraform&#34;&gt;resource &amp;#34;grafana_sso_settings&amp;#34; &amp;#34;saml_sso_settings&amp;#34; {
  provider_name = &amp;#34;saml&amp;#34;
  saml_settings {
    name                       = &amp;#34;SAML&amp;#34;
    auto_login                 = false
    certificate_path           = &amp;#34;/path/to/certificate.cert&amp;#34;
    private_key_path           = &amp;#34;/path/to/private_key.pem&amp;#34;
    idp_metadata_path          = &amp;#34;/my/metadata.xml&amp;#34;
    max_issue_delay            = &amp;#34;90s&amp;#34;
    metadata_valid_duration    = &amp;#34;48h&amp;#34;
    assertion_attribute_name   = &amp;#34;displayName&amp;#34;
    assertion_attribute_login  = &amp;#34;mail&amp;#34;
    assertion_attribute_email  = &amp;#34;mail&amp;#34;
    assertion_attribute_groups = &amp;#34;Group&amp;#34;
    assertion_attribute_role   = &amp;#34;Role&amp;#34;
    assertion_attribute_org    = &amp;#34;Org&amp;#34;
    role_values_editor         = &amp;#34;editor, developer&amp;#34;
    role_values_admin          = &amp;#34;admin, operator&amp;#34;
    role_values_grafana_admin  = &amp;#34;superadmin&amp;#34;
    org_mapping                = &amp;#34;Engineering:2:Editor, Engineering:3:Viewer, Sales:3:Editor, *:1:Editor&amp;#34;
    allowed_organizations      = &amp;#34;Engineering, Sales&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Go to 
    &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/v12.4/docs/resources/sso_settings&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Terraform Registry&lt;/a&gt; for a complete reference on using the &lt;code&gt;grafana_sso_settings&lt;/code&gt; resource.&lt;/p&gt;
]]></content><description>&lt;h1 id="saml-configuration-options">SAML configuration options&lt;/h1>
&lt;p>This page provides a comprehensive guide to configuring SAML authentication in Grafana. You&amp;rsquo;ll find detailed configuration examples, available settings, and their descriptions to help you set up and customize SAML authentication for your Grafana instance.&lt;/p></description></item><item><title>Configure SAML signing and encryption</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-signing-encryption/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-signing-encryption/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-signing-and-encryption&#34;&gt;Configure SAML signing and encryption&lt;/h1&gt;
&lt;p&gt;Grafana supports signed and encrypted responses, and &lt;em&gt;only&lt;/em&gt; supports signed requests.&lt;/p&gt;
&lt;h2 id=&#34;certificate-and-private-key&#34;&gt;Certificate and private key&lt;/h2&gt;
&lt;p&gt;Commonly, the certificate and key are embedded in the IdP metadata and refreshed as needed by Grafana automatically. However, if your IdP expects signed requests, you must supply a certificate and private key.&lt;/p&gt;
&lt;p&gt;The SAML SSO standard uses asymmetric encryption to exchange information between the SP (Grafana) and the IdP. To perform such encryption, you need a public part and a private part. In this case, the X.509 certificate provides the public part, while the private key provides the private part. The private key needs to be issued in a &lt;a href=&#34;https://en.wikipedia.org/wiki/PKCS_8&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PKCS#8&lt;/a&gt; format.&lt;/p&gt;
&lt;p&gt;If you are directly supplying the certificate and key, Grafana supports two ways of specifying both the &lt;code&gt;certificate&lt;/code&gt; and &lt;code&gt;private_key&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Without a suffix (&lt;code&gt;certificate&lt;/code&gt; or &lt;code&gt;private_key&lt;/code&gt;), the configuration assumes you&amp;rsquo;ve supplied the base64-encoded file contents.&lt;/li&gt;
&lt;li&gt;With the &lt;code&gt;_path&lt;/code&gt; suffix (&lt;code&gt;certificate_path&lt;/code&gt; or &lt;code&gt;private_key_path&lt;/code&gt;), then Grafana treats the value entered as a path and attempts to read the file from the file system.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You can only use one form of each configuration option. Using multiple forms, such as both &lt;code&gt;certificate&lt;/code&gt; and &lt;code&gt;certificate_path&lt;/code&gt;, results in an error.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Always work with your company&amp;rsquo;s security team on setting up certificates and private keys. If you need to generate them yourself (such as in the short term, for testing purposes, and so on), use the following example to generate your certificate and private key, including the step of ensuring that the key is generated with the &lt;a href=&#34;https://en.wikipedia.org/wiki/PKCS_8&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PKCS#8&lt;/a&gt; format.&lt;/p&gt;
&lt;h2 id=&#34;signature-algorithm&#34;&gt;Signature algorithm&lt;/h2&gt;
&lt;p&gt;The SAML standard requires digital signatures for security-critical messages such as authentication and logout requests. When you configure the &lt;code&gt;signature_algorithm&lt;/code&gt; option, Grafana automatically signs these SAML requests using your configured private key and certificate.&lt;/p&gt;
&lt;h3 id=&#34;supported-algorithms&#34;&gt;Supported algorithms&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rsa-sha1&lt;/code&gt;: Legacy algorithm, not recommended for new deployments&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rsa-sha256&lt;/code&gt;: Recommended for most use cases&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rsa-sha512&lt;/code&gt;: Strongest security, but may impact performance&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;important-considerations&#34;&gt;Important considerations&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The signature algorithm must match your IdP configuration exactly&lt;/li&gt;
&lt;li&gt;Mismatched algorithms will cause signature validation failures&lt;/li&gt;
&lt;li&gt;Grafana uses the key and certificate specified in &lt;code&gt;private_key&lt;/code&gt; and &lt;code&gt;certificate&lt;/code&gt; options for signing&lt;/li&gt;
&lt;li&gt;We recommend using &lt;code&gt;rsa-sha256&lt;/code&gt; for new SAML implementations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;example-of-private-key-generation-for-saml-authentication&#34;&gt;Example of private key generation for SAML authentication&lt;/h2&gt;
&lt;p&gt;An example of how to generate a self-signed certificate and private key that&amp;rsquo;s valid for one year:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes​&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Base64-encode the cert.pem and key.pem files:
(-w0 switch is not needed on Mac, only for Linux)&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;$ base64 -i key.pem -o key.pem.base64
$ base64 -i cert.pem -o cert.pem.base64&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The base64-encoded values (&lt;code&gt;key.pem.base64, cert.pem.base64&lt;/code&gt; files) are then used for &lt;code&gt;certificate&lt;/code&gt; and &lt;code&gt;private key&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The key you provide should look like:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;-----BEGIN PRIVATE KEY-----
...
...
-----END PRIVATE KEY-----&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-saml-signing-and-encryption">Configure SAML signing and encryption&lt;/h1>
&lt;p>Grafana supports signed and encrypted responses, and &lt;em>only&lt;/em> supports signed requests.&lt;/p>
&lt;h2 id="certificate-and-private-key">Certificate and private key&lt;/h2>
&lt;p>Commonly, the certificate and key are embedded in the IdP metadata and refreshed as needed by Grafana automatically. However, if your IdP expects signed requests, you must supply a certificate and private key.&lt;/p></description></item><item><title>Configure Role and Team sync for SAML</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-team-role-mapping/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-team-role-mapping/</guid><content><![CDATA[&lt;h1 id=&#34;configure-team-sync-for-saml&#34;&gt;Configure team sync for SAML&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Available in 
    &lt;a href=&#34;/docs/grafana/v12.4/introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt; and to customers on select Grafana Cloud plans. For pricing information, visit &lt;a href=&#34;/pricing/&#34;&gt;pricing&lt;/a&gt; or contact our sales team.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To use SAML Team sync, set 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#assertion_attribute_groups&#34;&gt;&lt;code&gt;assertion_attribute_groups&lt;/code&gt;&lt;/a&gt; to the attribute name where you store user groups. Then Grafana will use attribute values extracted from SAML assertion to add user into the groups with the same name configured on the External group sync tab.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Grafana requires the SAML groups attribute to be configured with distinct &lt;code&gt;AttributeValue&lt;/code&gt; elements for each group. Do not include multiple groups within a single &lt;code&gt;AttributeValue&lt;/code&gt; delimited by a comma or any other character. Failure to do so will prevent correct group parsing. Example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;xml&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-xml&#34;&gt;&amp;lt;saml2:Attribute ...&amp;gt;
    &amp;lt;saml2:AttributeValue ...&amp;gt;admins_group&amp;lt;/saml2:AttributeValue&amp;gt;
    &amp;lt;saml2:AttributeValue ...&amp;gt;division_1&amp;lt;/saml2:AttributeValue&amp;gt;
&amp;lt;/saml2:Attribute&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Team Sync allows you sync users from SAML to Grafana teams. It does not automatically create teams in Grafana. You need to create teams in Grafana before you can use this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Given the following partial SAML assertion:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;xml&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-xml&#34;&gt;&amp;lt;saml2:Attribute
    Name=&amp;#34;groups&amp;#34;
    NameFormat=&amp;#34;urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified&amp;#34;&amp;gt;
    &amp;lt;saml2:AttributeValue
        xmlns:xs=&amp;#34;http://www.w3.org/2001/XMLSchema&amp;#34;
        xmlns:xsi=&amp;#34;http://www.w3.org/2001/XMLSchema-instance&amp;#34;
        xsi:type=&amp;#34;xs:string&amp;#34;&amp;gt;admins_group
    &amp;lt;/saml2:AttributeValue&amp;gt;
    &amp;lt;saml2:AttributeValue
        xmlns:xs=&amp;#34;http://www.w3.org/2001/XMLSchema&amp;#34;
        xmlns:xsi=&amp;#34;http://www.w3.org/2001/XMLSchema-instance&amp;#34;
        xsi:type=&amp;#34;xs:string&amp;#34;&amp;gt;division_1
    &amp;lt;/saml2:AttributeValue&amp;gt;
&amp;lt;/saml2:Attribute&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The configuration would look like this:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
# ...
assertion_attribute_groups = groups&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The following &lt;code&gt;External Group ID&lt;/code&gt;s would be valid for input in the desired team&amp;rsquo;s &lt;em&gt;External group sync&lt;/em&gt; tab:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;admins_group&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;division_1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&#34;configure-role-sync-for-saml&#34;&gt;Configure role sync for SAML&lt;/h1&gt;
&lt;p&gt;Role sync allows you to map user roles from an identity provider to Grafana. To enable role sync, configure role attribute and possible values for the Editor, Admin, and Grafana Admin roles. For more information about user roles, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/roles-and-permissions/&#34;&gt;Roles and permissions&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the configuration file, set 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#assertion_attribute_role&#34;&gt;&lt;code&gt;assertion_attribute_role&lt;/code&gt;&lt;/a&gt; option to the attribute name where the role information will be extracted from.&lt;/li&gt;
&lt;li&gt;Set the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#role_values_none&#34;&gt;&lt;code&gt;role_values_none&lt;/code&gt;&lt;/a&gt; option to the values mapped to the &lt;code&gt;None&lt;/code&gt; role.&lt;/li&gt;
&lt;li&gt;Set the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#role_values_viewer&#34;&gt;&lt;code&gt;role_values_viewer&lt;/code&gt;&lt;/a&gt; option to the values mapped to the &lt;code&gt;Viewer&lt;/code&gt; role.&lt;/li&gt;
&lt;li&gt;Set the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#role_values_editor&#34;&gt;&lt;code&gt;role_values_editor&lt;/code&gt;&lt;/a&gt; option to the values mapped to the &lt;code&gt;Editor&lt;/code&gt; role.&lt;/li&gt;
&lt;li&gt;Set the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#role_values_admin&#34;&gt;&lt;code&gt;role_values_admin&lt;/code&gt;&lt;/a&gt; option to the values mapped to the organization &lt;code&gt;Admin&lt;/code&gt; role.&lt;/li&gt;
&lt;li&gt;Set the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#role_values_grafana_admin&#34;&gt;&lt;code&gt;role_values_grafana_admin&lt;/code&gt;&lt;/a&gt; option to the values mapped to the &lt;code&gt;Grafana Admin&lt;/code&gt; role.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If a user role doesn&amp;rsquo;t match any of configured values, then the role specified by the &lt;code&gt;auto_assign_org_role&lt;/code&gt; configuration option will be assigned. If the &lt;code&gt;auto_assign_org_role&lt;/code&gt; field is not set then the user role will default to &lt;code&gt;Viewer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For more information about roles and permissions in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/roles-and-permissions/&#34;&gt;Roles and permissions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Example configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
assertion_attribute_role = role
role_values_none = none
role_values_viewer = external
role_values_editor = editor, developer
role_values_admin = admin, operator
role_values_grafana_admin = superadmin&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: When role sync is configured, any changes of user roles and organization membership made manually in Grafana will be overwritten on next user login. Assign user organizations and roles in the IdP instead.&lt;/p&gt;
&lt;p&gt;If you don&amp;rsquo;t want user organizations and roles to be synchronized with the IdP, you can use the &lt;code&gt;skip_org_role_sync&lt;/code&gt; configuration option.&lt;/p&gt;
&lt;p&gt;Example configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
skip_org_role_sync = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-team-sync-for-saml">Configure team sync for SAML&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Available in
&lt;a href="/docs/grafana/v12.4/introduction/grafana-enterprise/">Grafana Enterprise&lt;/a> and to customers on select Grafana Cloud plans. For pricing information, visit &lt;a href="/pricing/">pricing&lt;/a> or contact our sales team.&lt;/p></description></item><item><title>Configure organization mapping for SAML</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-org-mapping/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-org-mapping/</guid><content><![CDATA[&lt;h1 id=&#34;configure-organization-mapping-for-saml&#34;&gt;Configure organization mapping for SAML&lt;/h1&gt;
&lt;p&gt;Organization mapping allows you to assign users to a particular organization in Grafana depending on attribute value obtained from the identity provider.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In configuration file, set 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#assertion_attribute_org&#34;&gt;&lt;code&gt;assertion_attribute_org&lt;/code&gt;&lt;/a&gt; to the attribute name you store organization info in. This attribute can be an array if you want a user to be in multiple organizations.&lt;/li&gt;
&lt;li&gt;Set 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/enterprise-configuration/#org_mapping&#34;&gt;&lt;code&gt;org_mapping&lt;/code&gt;&lt;/a&gt; option to the comma-separated list of &lt;code&gt;Organization:OrgId&lt;/code&gt; pairs to map organization from IdP to Grafana organization specified by ID. If you want users to have different roles in multiple organizations, you can set this option to a comma-separated list of &lt;code&gt;Organization:OrgId:Role&lt;/code&gt; mappings.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, use following configuration to assign users from &lt;code&gt;Engineering&lt;/code&gt; organization to the Grafana organization with ID &lt;code&gt;2&lt;/code&gt; as Editor and users from &lt;code&gt;Sales&lt;/code&gt; - to the org with ID &lt;code&gt;3&lt;/code&gt; as Admin, based on &lt;code&gt;Org&lt;/code&gt; assertion attribute value:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
assertion_attribute_org = Org
org_mapping = Engineering:2:Editor, Sales:3:Admin&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;The &lt;code&gt;org_mapping&lt;/code&gt; option stores mappings in the database as JSON. Size limits depend on your database. In MySQL before Grafana 12.3, the limit is 65,535 bytes. From Grafana 12.3, the column uses &lt;code&gt;MEDIUMTEXT&lt;/code&gt;, raising the MySQL limit to 16,777,215 bytes (~16 MB). If you need to split users into more granular control, we suggest using &lt;a href=&#34;../configure-saml-team-role-mapping/&#34;&gt;Role and Team Sync&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Starting from Grafana version 11.5, you can use the organization name instead of the organization ID in the &lt;code&gt;org_mapping&lt;/code&gt; option. Ensure that the organization name you configure matches exactly with the organization name in Grafana, as it is case-sensitive. If the organization name is not found in Grafana, the mapping will be ignored. If the external organization or the organization name contains spaces, use the JSON syntax for the &lt;code&gt;org_mapping&lt;/code&gt; option:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;org_mapping = [&amp;#34;Org 1:2:Editor&amp;#34;, &amp;#34;ExternalOrg:ACME Corp.:Admin&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If one of the mappings contains a &lt;code&gt;:&lt;/code&gt;, use the JSON syntax and escape the &lt;code&gt;:&lt;/code&gt; with a backslash:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;# Assign users from &amp;#34;External:Admin&amp;#34; to the organization with name &amp;#34;ACME Corp&amp;#34; as Admin
org_mapping = [&amp;#34;External\:Admin:ACME Corp:Admin&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For example, to assign users from &lt;code&gt;Engineering&lt;/code&gt; organization to the Grafana organization with name &lt;code&gt;ACME Corp&lt;/code&gt; as Editor and users from &lt;code&gt;Sales&lt;/code&gt; - to the org with id &lt;code&gt;3&lt;/code&gt; as Admin, based on &lt;code&gt;Org&lt;/code&gt; assertion attribute value:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[auth.saml]
assertion_attribute_org = Org
org_mapping = [&amp;#34;Engineering:ACME Corp:Editor&amp;#34;, &amp;#34;Sales:3:Admin&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can specify multiple organizations both for the IdP and Grafana:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;org_mapping = Engineering:2, Sales:2&lt;/code&gt; to map users from &lt;code&gt;Engineering&lt;/code&gt; and &lt;code&gt;Sales&lt;/code&gt; to &lt;code&gt;2&lt;/code&gt; in Grafana.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org_mapping = Engineering:2, Engineering:3&lt;/code&gt; to assign &lt;code&gt;Engineering&lt;/code&gt; to both &lt;code&gt;2&lt;/code&gt; and &lt;code&gt;3&lt;/code&gt; in Grafana.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use &lt;code&gt;*&lt;/code&gt; as the SAML Organization if you want all your users to be in some Grafana organizations with a default role:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;org_mapping = *:2:Editor&lt;/code&gt; to map all users to the organization which ID is &lt;code&gt;2&lt;/code&gt; in Grafana as Editors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use &lt;code&gt;*&lt;/code&gt; as the Grafana organization in the mapping if you want all users from a given SAML Organization to be added to all existing Grafana organizations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;org_mapping = Engineering:*&lt;/code&gt; to map users from &lt;code&gt;Engineering&lt;/code&gt; to all existing Grafana organizations.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org_mapping = Administration:*:Admin&lt;/code&gt; to map users from &lt;code&gt;Administration&lt;/code&gt; to all existing Grafana organizations as Admins.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-organization-mapping-for-saml">Configure organization mapping for SAML&lt;/h1>
&lt;p>Organization mapping allows you to assign users to a particular organization in Grafana depending on attribute value obtained from the identity provider.&lt;/p></description></item><item><title>Configure SAML single logout</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-single-logout/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-single-logout/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-single-logout&#34;&gt;Configure SAML Single Logout&lt;/h1&gt;
&lt;p&gt;The single logout feature allows users to log out from all applications associated with the current IdP session established via SAML SSO. If the &lt;code&gt;single_logout&lt;/code&gt; option is set to &lt;code&gt;true&lt;/code&gt; and a user logs out, Grafana requests IdP to end the user session which in turn triggers logout from all other applications the user is logged into using the same IdP session (applications should support single logout). Conversely, if another application connected to the same IdP logs out using single logout, Grafana receives a logout request from IdP and ends the user session.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The improved SLO features, including proper handling of the IdP&amp;rsquo;s SessionIndex, are currently behind the &lt;code&gt;improvedExternalSessionHandlingSAML&lt;/code&gt; feature toggle. When this feature toggle is enabled, Grafana will correctly handle session-specific logouts. If the feature toggle is not enabled, logging out will end all of the user&amp;rsquo;s sessions.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

]]></content><description>&lt;h1 id="configure-saml-single-logout">Configure SAML Single Logout&lt;/h1>
&lt;p>The single logout feature allows users to log out from all applications associated with the current IdP session established via SAML SSO. If the &lt;code>single_logout&lt;/code> option is set to &lt;code>true&lt;/code> and a user logs out, Grafana requests IdP to end the user session which in turn triggers logout from all other applications the user is logged into using the same IdP session (applications should support single logout). Conversely, if another application connected to the same IdP logs out using single logout, Grafana receives a logout request from IdP and ends the user session.&lt;/p></description></item><item><title>Configure SAML authentication with Microsoft Entra ID</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-entraid/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-entraid/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-with-microsoft-entra-id&#34;&gt;Configure SAML with Microsoft Entra ID&lt;/h1&gt;
&lt;p&gt;Grafana supports user authentication through &lt;a href=&#34;https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Microsoft Entra ID&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Starting in Grafana v11.2, the SAML integration offers a mechanism to retrieve user groups from the Graph API.&lt;/p&gt;
&lt;p&gt;Grafana versions 11.1 and below do not support fetching groups from the Graph API endpoint. As a result, users with more than 150 groups will not be able to retrieve their groups. Instead, use the Entra ID connector.&lt;/p&gt;
&lt;p&gt;Related links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference#groups-overage-claim&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Entra ID SAML limitations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-a-graph-api-application-in-entra-id&#34;&gt;Configure a Graph API application in Entra ID&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Ensure you have permission to administer SAML authentication. For more information about roles and permissions in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/roles-and-permissions/&#34;&gt;Roles and permissions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have users that belong to more than 150 groups, configure a registered application to provide an Entra ID Graph API to retrieve the groups. Refer to &lt;a href=&#34;#configure-a-graph-api-application-in-entra-id&#34;&gt;Setup Entra ID Graph API applications&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;generate-self-signed-certificates&#34;&gt;Generate self-signed certificates&lt;/h2&gt;
&lt;p&gt;Entra ID requires a certificate to verify the SAML requests&amp;rsquo; signature. You can generate a private key and a self-signed certificate using the following command (the private key used to sign the requests and the certificate contains the public key for verification):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This will generate a &lt;code&gt;key.pem&lt;/code&gt; and &lt;code&gt;cert.pem&lt;/code&gt; file that you can use for the &lt;code&gt;private_key_path&lt;/code&gt; and &lt;code&gt;certificate_path&lt;/code&gt; configuration options.&lt;/p&gt;
&lt;h2 id=&#34;add-the-microsoft-entra-saml-toolkit-from-the-gallery&#34;&gt;Add the Microsoft Entra SAML Toolkit from the gallery&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Taken from &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity/saas-apps/saml-toolkit-tutorial#add-microsoft-entra-saml-toolkit-from-the-gallery&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://learn.microsoft.com/en-us/entra/identity/saas-apps/saml-toolkit-tutorial#add-microsoft-entra-saml-toolkit-from-the-gallery&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href=&#34;https://portal.azure.com/#home&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure portal&lt;/a&gt; and sign in with your Entra ID account.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;Enterprise Applications&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Enterprise applications&lt;/strong&gt; pane, select &lt;strong&gt;New application&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the search box, enter &lt;strong&gt;SAML Toolkit&lt;/strong&gt;, and then select the &lt;strong&gt;Microsoft Entra SAML Toolkit&lt;/strong&gt; from the results panel.&lt;/li&gt;
&lt;li&gt;Add a descriptive name and select &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-the-saml-toolkit-application-endpoints&#34;&gt;Configure the SAML Toolkit application endpoints&lt;/h2&gt;
&lt;p&gt;In order to validate Entra ID users with Grafana, you need to configure the SAML Toolkit application endpoints by creating a new SAML integration in the Entra ID organization.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For the following configuration, we will use &lt;code&gt;https://localhost&lt;/code&gt; as the Grafana URL. Replace it with your Grafana URL.&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;SAML Toolkit application&lt;/strong&gt;, select &lt;strong&gt;Set up single sign-on&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Single sign-on&lt;/strong&gt; pane, select &lt;strong&gt;SAML&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the Set up &lt;strong&gt;Single Sign-On with SAML&lt;/strong&gt; pane, select the pencil icon for &lt;strong&gt;Basic SAML Configuration&lt;/strong&gt; to edit the settings.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Basic SAML Configuration&lt;/strong&gt; pane, click on the &lt;strong&gt;Edit&lt;/strong&gt; button and update the following fields:
&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Identifier (Entity ID)&lt;/strong&gt; field, enter &lt;code&gt;https://localhost/saml/metadata&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Reply URL (Assertion Consumer Service URL)&lt;/strong&gt; field, enter &lt;code&gt;https://localhost/saml/acs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Sign on URL&lt;/strong&gt; field, enter &lt;code&gt;https://localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Relay State&lt;/strong&gt; field, enter &lt;code&gt;https://localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Logout URL&lt;/strong&gt; field, enter &lt;code&gt;https://localhost/saml/slo&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;At the &lt;strong&gt;SAML Certificate&lt;/strong&gt; section, copy the &lt;strong&gt;App Federation Metadata Url&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Use this URL in the &lt;code&gt;idp_metadata_url&lt;/code&gt; field in the &lt;code&gt;custom.ini&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;generate-a-client-secret&#34;&gt;Generate a client secret&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;Overview&lt;/strong&gt; pane, select &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;New client secret&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Add a client secret&lt;/strong&gt; pane, enter a description for the secret.&lt;/li&gt;
&lt;li&gt;Set the expiration date for the secret.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Add&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Copy the value of the secret. This value is used in the &lt;code&gt;client_secret&lt;/code&gt; field in the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-configuration-options/&#34;&gt;SAML configuration&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-saml-assertions-to-use-scim-provisioning&#34;&gt;Configure SAML assertions to use SCIM provisioning&lt;/h2&gt;
&lt;p&gt;In order to verify the logged in user is the same user that was provisioned through Entra ID, you need to include the same &lt;code&gt;externalId&lt;/code&gt; in the SAML assertion by mapping the SAML assertion &lt;code&gt;assertion_attribute_external_id&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your Entra ID application.&lt;/li&gt;
&lt;li&gt;Select the SAML single sign-on configuration.&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;Attributes &amp;amp; Claims&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;Add a new claim with the following settings:
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;userUID&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Namespace: leave blank&lt;/li&gt;
&lt;li&gt;Source: Attribute&lt;/li&gt;
&lt;li&gt;Source attribute: &lt;code&gt;user.objectId&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Save&lt;/strong&gt; the current configuration.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;adjust-your-user-mapping-configuration-to-use-the-entra-id-uri&#34;&gt;Adjust your user mapping configuration to use the Entra ID URI&lt;/h2&gt;
&lt;p&gt;If the default URI claims don&amp;rsquo;t work, adjust your user mapping to the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name attribute = &lt;a href=&#34;http://schemas.microsoft.com/identity/claims/displayname&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://schemas.microsoft.com/identity/claims/displayname&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Login attribute = &lt;a href=&#34;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Email attribute = &lt;a href=&#34;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-a-graph-api-application-in-entra-id&#34;&gt;Configure a Graph API application in Entra ID&lt;/h2&gt;
&lt;p&gt;While you can configure an Entra ID tenant in Grafana via SAML, some additional information is only accessible via the Graph API. To retrieve this information, create a new application in Entra ID and grant it the necessary permissions. To learn more refer to &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference#groups-overage-claim&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Entra ID SAML limitations&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following configuration example uses the URL &lt;code&gt;https://localhost&lt;/code&gt; as the Grafana URL. Replace it with your Grafana instance URL.&lt;/p&gt;
&lt;h3 id=&#34;create-a-new-app-registration&#34;&gt;Create a new App registration&lt;/h3&gt;
&lt;p&gt;This app registration is used as a Service Account to retrieve more information about the Entra ID user.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href=&#34;https://portal.azure.com/#home&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure portal&lt;/a&gt; and sign in with your Entra ID account.&lt;/li&gt;
&lt;li&gt;In the left-hand navigation pane, select the Microsoft Entra ID service, and then select &lt;strong&gt;App registrations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;New registration&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Register an application&lt;/strong&gt; pane, enter a name for the application.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Supported account types&lt;/strong&gt; section, select the account types that can use the application.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Redirect URI&lt;/strong&gt; section, select Web and enter &lt;code&gt;https://localhost/login/azuread&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Register&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-up-permissions-for-the-application&#34;&gt;Set up permissions for the application&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;In the overview pane, look for &lt;strong&gt;API permissions&lt;/strong&gt; section and select &lt;strong&gt;Add a permission&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Request API permissions&lt;/strong&gt; pane, select &lt;strong&gt;Microsoft Graph&lt;/strong&gt;, and click &lt;strong&gt;Application permissions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Select permissions&lt;/strong&gt; pane, under the &lt;strong&gt;GroupMember&lt;/strong&gt; section, select &lt;strong&gt;GroupMember.Read.All&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Select permissions&lt;/strong&gt; pane, under the &lt;strong&gt;User&lt;/strong&gt; section, select &lt;strong&gt;User.Read.All&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Add permissions&lt;/strong&gt; button at the bottom of the page.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Request API permissions&lt;/strong&gt; pane, select &lt;strong&gt;Microsoft Graph&lt;/strong&gt;, and click &lt;strong&gt;Delegated permissions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Select permissions&lt;/strong&gt; pane, under the &lt;strong&gt;User&lt;/strong&gt; section, select &lt;strong&gt;User.Read&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Add permissions&lt;/strong&gt; button at the bottom of the page.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;API permissions&lt;/strong&gt; section, select &lt;strong&gt;Grant admin consent for &lt;code&gt;&amp;lt;directory-name&amp;gt;&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following table shows what the permissions look like from the Entra ID portal:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Permissions name&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Admin consent required&lt;/th&gt;
              &lt;th&gt;Status&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GroupMember.Read.All&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Application&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Granted&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User.Read&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Delegated&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Granted&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User.Read.All&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Application&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Granted&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1013px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/IAM/image.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/IAM/image.png&#34;data-srcset=&#34;/media/docs/IAM/image.png?w=320 320w, /media/docs/IAM/image.png?w=550 550w, /media/docs/IAM/image.png?w=750 750w, /media/docs/IAM/image.png?w=900 900w, /media/docs/IAM/image.png?w=1040 1040w, /media/docs/IAM/image.png?w=1240 1240w, /media/docs/IAM/image.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screen shot of the permissions listed in Entra ID for the App registration&#34;width=&#34;1013&#34;height=&#34;220&#34;title=&#34;Screen shot of the permissions listed in Entra ID for the App registration&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/IAM/image.png&#34;
            alt=&#34;Screen shot of the permissions listed in Entra ID for the App registration&#34;width=&#34;1013&#34;height=&#34;220&#34;title=&#34;Screen shot of the permissions listed in Entra ID for the App registration&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screen shot of the permissions listed in Entra ID for the App registration&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To test that Graph API has the correct permissions, refer to the &lt;a href=&#34;../troubleshoot-saml/#troubleshoot-graph-api-calls&#34;&gt;Troubleshoot Graph API calls&lt;/a&gt; section.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-saml-with-microsoft-entra-id">Configure SAML with Microsoft Entra ID&lt;/h1>
&lt;p>Grafana supports user authentication through &lt;a href="https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id" target="_blank" rel="noopener noreferrer">Microsoft Entra ID&lt;/a>.&lt;/p>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Starting in Grafana v11.2, the SAML integration offers a mechanism to retrieve user groups from the Graph API.&lt;/p></description></item><item><title>Configure SAML authentication with Okta</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-okta/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-okta/</guid><content><![CDATA[&lt;h1 id=&#34;configure-saml-okta&#34;&gt;Configure SAML Okta&lt;/h1&gt;
&lt;p&gt;Grafana supports user authentication through Okta, which is useful when you want your users to access Grafana using single sign on. This guide will follow you through the steps of configuring SAML authentication in Grafana with &lt;a href=&#34;https://okta.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Okta&lt;/a&gt;. You need to be an admin in your Okta organization to access Admin Console and create SAML integration. You also need permissions to edit Grafana configuration file and restart Grafana server.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To configure SAML integration with Okta, create an app integration inside the Okta organization first. &lt;a href=&#34;https://help.okta.com/en/prod/Content/Topics/Apps/apps-overview-add-apps.htm&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Add app integration in Okta&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ensure you have permission to administer SAML authentication. For more information about roles and permissions in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/roles-and-permissions/&#34;&gt;Roles and permissions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;set-up-saml-with-okta&#34;&gt;Set up SAML with Okta&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;These steps are for assistance only, refer to the &lt;a href=&#34;https://help.okta.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;official Okta documentation&lt;/a&gt; for the up-to-date instructions.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to the &lt;a href=&#34;https://login.okta.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Okta portal&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to the Admin Console in your Okta organization by clicking &lt;strong&gt;Admin&lt;/strong&gt; in the upper-right corner. If you are in the Developer Console, then click &lt;strong&gt;Developer Console&lt;/strong&gt; in the upper-left corner and then click &lt;strong&gt;Classic UI&lt;/strong&gt; to switch over to the Admin Console.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Admin Console, navigate to &lt;strong&gt;Applications&lt;/strong&gt; &amp;gt; &lt;strong&gt;Applications&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Create App Integration&lt;/strong&gt; to start the Application Integration Wizard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose &lt;strong&gt;SAML 2.0&lt;/strong&gt; as the &lt;strong&gt;Sign-in method&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;General Settings&lt;/strong&gt; tab, enter a name for your Grafana integration. You can also upload a logo.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;Configure SAML&lt;/strong&gt; tab, enter the SAML information related to your Grafana instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Single sign on URL&lt;/strong&gt; field, use the &lt;code&gt;/saml/acs&lt;/code&gt; endpoint URL of your Grafana instance, for example, &lt;code&gt;https://grafana.example.com/saml/acs&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Audience URI (SP Entity ID)&lt;/strong&gt; field, use the &lt;code&gt;/saml/metadata&lt;/code&gt; endpoint URL, by default it is the &lt;code&gt;/saml/metadata&lt;/code&gt; endpoint of your Grafana instance (for example &lt;code&gt;https://example.grafana.com/saml/metadata&lt;/code&gt;). This could be configured differently, but the value here must match the &lt;code&gt;entity_id&lt;/code&gt; setting of the SAML settings of Grafana.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Leave the default values for &lt;strong&gt;Name ID format&lt;/strong&gt; and &lt;strong&gt;Application username&lt;/strong&gt;.


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If you plan to enable SAML Single Logout, consider setting the &lt;strong&gt;Name ID format&lt;/strong&gt; to &lt;code&gt;EmailAddress&lt;/code&gt; or &lt;code&gt;Persistent&lt;/code&gt;. This must match the &lt;code&gt;name_id_format&lt;/code&gt; setting of the Grafana instance.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;ATTRIBUTE STATEMENTS (REQUIRED)&lt;/strong&gt; section, enter the SAML attributes to be shared with Grafana. The attribute names in Okta need to match exactly what is defined within Grafana, for example:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Attribute name (in Grafana)&lt;/th&gt;
              &lt;th&gt;Name and value (in Okta profile)&lt;/th&gt;
              &lt;th&gt;Grafana configuration (under &lt;code&gt;auth.saml&lt;/code&gt;)&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Login&lt;/td&gt;
              &lt;td&gt;Login - &lt;code&gt;user.login&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_login = Login&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Email&lt;/td&gt;
              &lt;td&gt;Email - &lt;code&gt;user.email&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_email = Email&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;DisplayName&lt;/td&gt;
              &lt;td&gt;DisplayName - &lt;code&gt;user.firstName &#43; &amp;quot; &amp;quot; &#43; user.lastName&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_name = DisplayName&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;GROUP ATTRIBUTE STATEMENTS (OPTIONAL)&lt;/strong&gt; section, enter a group attribute name (for example, &lt;code&gt;Group&lt;/code&gt;, ensure it matches the &lt;code&gt;asssertion_attribute_groups&lt;/code&gt; setting in Grafana) and set filter to &lt;code&gt;Matches regex .*&lt;/code&gt; to return all user groups.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the final Feedback tab, fill out the form and then click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-saml-assertions-when-using-scim-provisioning&#34;&gt;Configure SAML assertions when using SCIM provisioning&lt;/h2&gt;
&lt;p&gt;In order to verify the logged in user is the same user that was provisioned through Okta, you need to include the same &lt;code&gt;externalId&lt;/code&gt; in the SAML assertion by mapping the SAML assertion &lt;code&gt;assertion_attribute_external_id&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your Okta application.&lt;/li&gt;
&lt;li&gt;Select the SAML single sign-on configuration.&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;Attributes &amp;amp; Claims&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;Add a new claim with the following settings:
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;userUID&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;example-configuration&#34;&gt;Example configuration&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Attribute name (in Grafana)&lt;/th&gt;
              &lt;th&gt;Name and value (in Okta profile)&lt;/th&gt;
              &lt;th&gt;Grafana default configuration (under &lt;code&gt;auth.saml&lt;/code&gt;)&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;userUID&lt;/td&gt;
              &lt;td&gt;userUID - &lt;code&gt;user.getInternalProperty(&amp;quot;id&amp;quot;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;assertion_attribute_login = userUID&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="configure-saml-okta">Configure SAML Okta&lt;/h1>
&lt;p>Grafana supports user authentication through Okta, which is useful when you want your users to access Grafana using single sign on. This guide will follow you through the steps of configuring SAML authentication in Grafana with &lt;a href="https://okta.com/" target="_blank" rel="noopener noreferrer">Okta&lt;/a>. You need to be an admin in your Okta organization to access Admin Console and create SAML integration. You also need permissions to edit Grafana configuration file and restart Grafana server.&lt;/p></description></item><item><title>Troubleshoot SAML configuration</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/troubleshoot-saml/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/troubleshoot-saml/</guid><content><![CDATA[&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;Following are common issues found in configuring SAML authentication in Grafana and how to resolve them.&lt;/p&gt;
&lt;h3 id=&#34;troubleshoot-saml-authentication-in-grafana&#34;&gt;Troubleshoot SAML authentication in Grafana&lt;/h3&gt;
&lt;p&gt;To troubleshoot and get more log information, enable SAML debug logging in the configuration file. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#filters&#34;&gt;Configuration&lt;/a&gt; for more information.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[log]
filters = saml.auth:debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;infinite-redirect-loop--user-gets-redirected-to-the-login-page-after-successful-login-on-the-idp-side&#34;&gt;Infinite redirect loop / User gets redirected to the login page after successful login on the IdP side&lt;/h3&gt;
&lt;p&gt;If you experience an infinite redirect loop when &lt;code&gt;auto_login = true&lt;/code&gt; or redirected to the login page after successful login, it is likely that the &lt;code&gt;grafana_session&lt;/code&gt; cookie&amp;rsquo;s SameSite setting is set to &lt;code&gt;Strict&lt;/code&gt;. This setting prevents the &lt;code&gt;grafana_session&lt;/code&gt; cookie from being sent to Grafana during cross-site requests. To resolve this issue, set the &lt;code&gt;security.cookie_samesite&lt;/code&gt; option to &lt;code&gt;Lax&lt;/code&gt; in the Grafana configuration file.&lt;/p&gt;
&lt;h3 id=&#34;saml-authentication-fails-with-error&#34;&gt;SAML authentication fails with error:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;asn1: structure error: tags don&#39;t match&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We only support one private key format: PKCS#8.&lt;/p&gt;
&lt;p&gt;The keys may be in a different format (PKCS#1 or PKCS#12); in that case, it may be necessary to convert the private key format.&lt;/p&gt;
&lt;p&gt;The following command creates a pkcs8 key file.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;convert-the-private-key-format-to-base64&#34;&gt;&lt;strong&gt;Convert&lt;/strong&gt; the private key format to base64&lt;/h4&gt;
&lt;p&gt;The following command converts keys to base64 format.&lt;/p&gt;
&lt;p&gt;Base64-encode the cert.pem and key.pem files:
(-w0 switch is not needed on Mac, only for Linux)&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;$ base64 -w0 key.pem &amp;gt; key.pem.base64
$ base64 -w0 cert.pem &amp;gt; cert.pem.base64&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The base64-encoded values (&lt;code&gt;key.pem.base64, cert.pem.base64&lt;/code&gt; files) are then used for certificate and &lt;code&gt;private_key&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The keys you provide should look like:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;-----BEGIN PRIVATE KEY-----
...
...
-----END PRIVATE KEY-----&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;saml-login-attempts-fail-with-request-response-origin-not-allowed&#34;&gt;SAML login attempts fail with request response &lt;code&gt;origin not allowed&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;When the user logs in using SAML and gets presented with &lt;code&gt;origin not allowed&lt;/code&gt;, the user might be issuing the login from an IdP (identity provider) service or the user is behind a reverse proxy. This potentially happens as the CSRF checks in Grafana deem the requests to be invalid. For more information &lt;a href=&#34;https://owasp.org/www-community/attacks/csrf&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;CSRF&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To solve this issue, you can configure either the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#csrf_trusted_origins&#34;&gt;&lt;code&gt;csrf_trusted_origins&lt;/code&gt;&lt;/a&gt; or 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#csrf_additional_headers&#34;&gt;&lt;code&gt;csrf_additional_headers&lt;/code&gt;&lt;/a&gt; option in the SAML configuration.&lt;/p&gt;
&lt;p&gt;Example of a configuration file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;# config.ini
...
[security]
csrf_trusted_origins = https://grafana.example.com
csrf_additional_headers = X-Forwarded-Host
...&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;saml-login-attempts-fail-with-request-response-login-session-has-expired&#34;&gt;SAML login attempts fail with request response &amp;ldquo;login session has expired&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;Accessing the Grafana login page from a URL that is not the root URL of the
Grafana server can cause the instance to return the following error: &amp;ldquo;login session has expired&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;If you are accessing Grafana through a proxy server, ensure that cookies are correctly
rewritten to the root URL of Grafana.
Cookies must be set on the same URL as the &lt;code&gt;root_url&lt;/code&gt; of Grafana. This is normally the reverse proxy&amp;rsquo;s domain/address.&lt;/p&gt;
&lt;p&gt;Review the cookie settings in your proxy server configuration to ensure that cookies are
not being discarded&lt;/p&gt;
&lt;p&gt;Review the following settings in your Grafana configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[security]
cookie_samesite = lax&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This setting should be set to &lt;code&gt;lax&lt;/code&gt; to allow Grafana session cookies to work correctly with redirects.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[security]
cookie_secure = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For enhanced security, set &lt;code&gt;cookie_secure&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, which forces cookies to be sent only via HTTPS.&lt;/p&gt;
&lt;h3 id=&#34;troubleshoot-graph-api-calls&#34;&gt;Troubleshoot Graph API calls&lt;/h3&gt;
&lt;p&gt;When setting up SAML authentication with Entra ID, you may encounter issues with Graph API calls. This can happen if the Entra ID application is not properly configured to allow Graph API access.&lt;/p&gt;
&lt;p&gt;To help in the troubleshooting process, test the Graph API calls using the following commands:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -X POST &amp;#34;{token_url}&amp;#34; \
  -H &amp;#34;Content-Type: application/x-www-form-urlencoded&amp;#34; \
  -d &amp;#34;grant_type=client_credentials&amp;amp;client_id={client_id}&amp;amp;client_secret={client_secret}&amp;amp;scope=https://graph.microsoft.com/.default&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Where the following values come from your &lt;a href=&#34;../saml-configuration-options/_index.md#saml-configuration-options&#34;&gt;SAML configuration&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;token_url&lt;/code&gt;: The token URL of your Entra ID application.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client_id&lt;/code&gt;: The client ID of your Entra ID application.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client_secret&lt;/code&gt;: The client secret of your Entra ID application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The response should look like:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;access_token&amp;#34;: &amp;#34;...ACCESS_TOKEN...&amp;#34;,
  &amp;#34;token_type&amp;#34;: &amp;#34;Bearer&amp;#34;,
  &amp;#34;expires_in&amp;#34;: 3600
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;code&gt;access_token&lt;/code&gt; to test the Graph API calls.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -X GET &amp;#34;https://graph.microsoft.com/v1.0/groups&amp;#34; \
  -H &amp;#34;Authorization: Bearer ${access_token}&amp;#34; \
  -H &amp;#34;Content-Type: application/json&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The response should look like:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;@odata.context&amp;#34;: &amp;#34;https://graph.microsoft.com/v1.0/$metadata#Collection(Edm.String)&amp;#34;,
  &amp;#34;value&amp;#34;: [&amp;#34;29f2e7c8-9b9d-443c-bc62-7d8cdcfcfe59&amp;#34;, &amp;#34;f0224e82-0eb8-4eda-8979-0c36e98deb00&amp;#34;]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If the second call fails due to 401 or 403, you may need to check the Entra ID application settings to ensure that Graph API access is enabled.&lt;/p&gt;
]]></content><description>&lt;h2 id="troubleshooting">Troubleshooting&lt;/h2>
&lt;p>Following are common issues found in configuring SAML authentication in Grafana and how to resolve them.&lt;/p>
&lt;h3 id="troubleshoot-saml-authentication-in-grafana">Troubleshoot SAML authentication in Grafana&lt;/h3>
&lt;p>To troubleshoot and get more log information, enable SAML debug logging in the configuration file. Refer to
&lt;a href="/docs/grafana/v12.4/setup-grafana/configure-grafana/#filters">Configuration&lt;/a> for more information.&lt;/p></description></item></channel></rss>