<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure authentication on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/</link><description>Recent content in Configure authentication 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/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure basic authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/grafana/</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/grafana/</guid><content><![CDATA[&lt;h1 id=&#34;configure-basic-authentication&#34;&gt;Configure basic authentication&lt;/h1&gt;
&lt;p&gt;Grafana provides a basic authentication system with password authentication enabled by default. This document details configuration options to manage and enhance basic authentication.&lt;/p&gt;
&lt;h2 id=&#34;disable-basic-authentication&#34;&gt;Disable basic authentication&lt;/h2&gt;
&lt;p&gt;To disable basic authentication, use the following 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;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;[auth.basic]
enabled = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;password-policy&#34;&gt;Password policy&lt;/h2&gt;
&lt;p&gt;By default, Grafana’s password policy requires a minimum of four characters for basic auth users. For a stronger password policy, enable the &lt;code&gt;password_policy&lt;/code&gt; configuration option.&lt;/p&gt;
&lt;p&gt;With the &lt;code&gt;password_policy&lt;/code&gt; option enabled, new and updated passwords must meet the following criteria:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At least 12 characters&lt;/li&gt;
&lt;li&gt;At least one uppercase letter&lt;/li&gt;
&lt;li&gt;At least one lowercase letter&lt;/li&gt;
&lt;li&gt;At least one number&lt;/li&gt;
&lt;li&gt;At least one special character&lt;/li&gt;
&lt;/ul&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;[auth.basic]
password_policy = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Existing passwords that do not comply with the new password policy will not be affected until the user updates their password.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;disable-login-form&#34;&gt;Disable login form&lt;/h2&gt;
&lt;p&gt;To hide the Grafana login form, use the following configuration setting:&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;[auth]
disable_login_form = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This can be helpful in setups where authentication is handled entirely through external mechanisms or single sign-on (SSO).&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-basic-authentication">Configure basic authentication&lt;/h1>
&lt;p>Grafana provides a basic authentication system with password authentication enabled by default. This document details configuration options to manage and enhance basic authentication.&lt;/p></description></item><item><title>Configure passwordless authentication with magic links</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/passwordless/</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/passwordless/</guid><content><![CDATA[&lt;h1 id=&#34;configure-passwordless-authentication-with-magic-links&#34;&gt;Configure passwordless authentication with magic links&lt;/h1&gt;
&lt;p&gt;Passwordless authentication lets Grafana users authenticate with a magic link or one-time password (OTP) sent via email.&lt;/p&gt;
&lt;h2 id=&#34;enable-passwordless-authentication&#34;&gt;Enable passwordless authentication&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;Passwordless authentication is an experimental feature. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided. Enable the &lt;code&gt;passwordlessMagicLinkAuthentication&lt;/code&gt; feature toggle in Grafana to use this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To enable passwordless authentication, use the following 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;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;[auth.passwordless]
enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;code-expiration&#34;&gt;Code expiration&lt;/h2&gt;
&lt;p&gt;By default, the one-time password (OTP) sent to a user&amp;rsquo;s email is valid for 20 minutes. Use the &lt;code&gt;code_expiration&lt;/code&gt; option to change the duration that the OTP is valid.&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;[auth.passwordless]
enabled = true
code_expiration = 20m&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;enable-smtp-server&#34;&gt;Enable SMTP server&lt;/h2&gt;
&lt;p&gt;The SMTP server must be enabled so that Grafana can send emails.
The following configuration enables the SMTP server.
For more information on configuring the SMTP server, refer to &lt;a href=&#34;/docs/grafana/latest/setup-grafana/configure-grafana/#smtp&#34;&gt;SMTP&lt;/a&gt;.&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;[smtp]
enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-passwordless-authentication-with-magic-links">Configure passwordless authentication with magic links&lt;/h1>
&lt;p>Passwordless authentication lets Grafana users authenticate with a magic link or one-time password (OTP) sent via email.&lt;/p>
&lt;h2 id="enable-passwordless-authentication">Enable passwordless authentication&lt;/h2>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p></description></item><item><title>Configure anonymous access</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/anonymous-auth/</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/anonymous-auth/</guid><content><![CDATA[&lt;h1 id=&#34;anonymous-authentication&#34;&gt;Anonymous authentication&lt;/h1&gt;
&lt;p&gt;You can make Grafana accessible without any login required by enabling anonymous access in the configuration file.&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;Anonymous users are charged as active users in Grafana Enterprise&lt;/p&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;To see the devices, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Permissions &lt;code&gt;users:read&lt;/code&gt; which is normally only granted to server admins, that allow you to read users and devices tab.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;anonymous-devices&#34;&gt;Anonymous devices&lt;/h2&gt;
&lt;p&gt;The anonymous devices feature enhances the management and monitoring of anonymous access within your Grafana instance. This feature is part of ongoing efforts to provide more control and transparency over anonymous usage.&lt;/p&gt;
&lt;p&gt;Users can now view anonymous usage statistics, including the count of devices and users over the last 30 days.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Administration -&amp;gt; Users&lt;/strong&gt; to access the anonymous devices tab.&lt;/li&gt;
&lt;li&gt;A new stat for the usage stats page -&amp;gt; Usage &amp;amp; Stats page shows the active anonymous devices last 30 days.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The number of anonymous devices is not limited by default. The configuration option &lt;code&gt;device_limit&lt;/code&gt; allows you to enforce a limit on the number of anonymous devices. This enables you to have greater control over the usage within your Grafana instance and keep the usage within the limits of your environment. Once the limit is reached, any new devices that try to access Grafana will be denied access.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;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;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;[auth.anonymous]
enabled = true

# Organization name that should be used for unauthenticated users
org_name = Main Org.

# Role for unauthenticated users, other valid values are `Editor` and `Admin`
org_role = Viewer

# Hide the Grafana version text from the footer and help tooltip for unauthenticated users (default: false)
hide_version = true

# Setting this limits the number of anonymous devices in your instance. Any new anonymous devices added after the limit has been reached will be denied access.
device_limit =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you change your organization name in the Grafana UI this setting needs to be updated to match the new name.&lt;/p&gt;
&lt;h2 id=&#34;licensing-for-anonymous-access&#34;&gt;Licensing for anonymous access&lt;/h2&gt;
&lt;p&gt;Grafana Enterprise (self-managed) licenses anonymous access as active users.&lt;/p&gt;
&lt;p&gt;Anonymous access lets people use Grafana without login credentials. It was an early way to share dashboards, but Public dashboards gives you a more secure way to share dashboards.&lt;/p&gt;
&lt;h3 id=&#34;how-anonymous-usage-is-counted&#34;&gt;How anonymous usage is counted&lt;/h3&gt;
&lt;p&gt;Grafana estimates anonymous active users from anonymous devices:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Counting rule&lt;/strong&gt;: Grafana counts 1 anonymous user for every 3 anonymous devices detected.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="anonymous-authentication">Anonymous authentication&lt;/h1>
&lt;p>You can make Grafana accessible without any login required by enabling anonymous access in the configuration file.&lt;/p>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Anonymous users are charged as active users in Grafana Enterprise&lt;/p></description></item><item><title>Configure LDAP authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/ldap/</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/ldap/</guid><content><![CDATA[&lt;h1 id=&#34;configure-ldap-authentication&#34;&gt;Configure LDAP authentication&lt;/h1&gt;
&lt;p&gt;The LDAP integration in Grafana allows your Grafana users to login with their LDAP credentials. You can also specify mappings between LDAP
group memberships and Grafana Organization user roles.&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;&lt;a href=&#34;../enhanced-ldap/&#34;&gt;Enhanced LDAP authentication&lt;/a&gt; is available in &lt;a href=&#34;/docs/grafana-cloud/&#34;&gt;Grafana Cloud&lt;/a&gt; and in &lt;a href=&#34;../../../../introduction/grafana-enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;../../../../administration/roles-and-permissions/access-control/&#34;&gt;Role-based access control&lt;/a&gt; to understand how you can control access with role-based permissions.&lt;/p&gt;
&lt;h2 id=&#34;supported-ldap-servers&#34;&gt;Supported LDAP Servers&lt;/h2&gt;
&lt;p&gt;Grafana uses a &lt;a href=&#34;https://github.com/go-ldap/ldap&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;third-party LDAP library&lt;/a&gt; under the hood that supports basic LDAP v3 functionality.
This means that you should be able to configure LDAP integration using any compliant LDAPv3 server, for example &lt;a href=&#34;#openldap&#34;&gt;OpenLDAP&lt;/a&gt; or
&lt;a href=&#34;#active-directory&#34;&gt;Active Directory&lt;/a&gt; among &lt;a href=&#34;https://en.wikipedia.org/wiki/Directory_service#LDAP_implementations&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;others&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;enable-ldap&#34;&gt;Enable LDAP&lt;/h2&gt;
&lt;p&gt;In order to use LDAP integration you&amp;rsquo;ll first need to enable LDAP in the &lt;a href=&#34;../../../configure-grafana/&#34;&gt;main config file&lt;/a&gt; as well as specify the path to the LDAP
specific configuration file (default: &lt;code&gt;/etc/grafana/ldap.toml&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;After enabling LDAP, the default behavior is for Grafana users to be created automatically upon successful LDAP authentication. If you prefer for only existing Grafana users to be able to sign in, you can change &lt;code&gt;allow_sign_up&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in the &lt;code&gt;[auth.ldap]&lt;/code&gt; section.&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.ldap]
# Set to `true` to enable LDAP integration (default: `false`)
enabled = true

# Path to the LDAP specific configuration file (default: `/etc/grafana/ldap.toml`)
config_file = /etc/grafana/ldap.toml

# Allow sign-up should be `true` (default) to allow Grafana to create users on successful LDAP authentication.
# If set to `false` only already existing Grafana users will be able to login.
allow_sign_up = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;disable-org-role-synchronization&#34;&gt;Disable org role synchronization&lt;/h2&gt;
&lt;p&gt;If you use LDAP to authenticate users but don&amp;rsquo;t use role mapping, and prefer to manually assign organizations
and roles, you can use the &lt;code&gt;skip_org_role_sync&lt;/code&gt; configuration 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;[auth.ldap]
# Set to `true` to enable LDAP integration (default: `false`)
enabled = true

# Path to the LDAP specific configuration file (default: `/etc/grafana/ldap.toml`)
config_file = /etc/grafana/ldap.toml

# Allow sign-up should be `true` (default) to allow Grafana to create users on successful LDAP authentication.
# If set to `false` only already existing Grafana users will be able to login.
allow_sign_up = true

# Prevent synchronizing ldap users organization roles
skip_org_role_sync = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;grafana-ldap-configuration&#34;&gt;Grafana LDAP Configuration&lt;/h2&gt;
&lt;p&gt;Depending on which LDAP server you&amp;rsquo;re using and how that&amp;rsquo;s configured, your Grafana LDAP configuration may vary.
See &lt;a href=&#34;#configuration-examples&#34;&gt;configuration examples&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LDAP specific configuration file (ldap.toml) example:&lt;/strong&gt;&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;[[servers]]
# Ldap server host (specify multiple hosts space separated)
host = &amp;#34;ldap.my_secure_remote_server.org&amp;#34;
# Default port is 389 or 636 if use_ssl = true
port = 636
# Set to true if LDAP server should use an encrypted TLS connection (either with STARTTLS or LDAPS)
use_ssl = true
# If set to true, use LDAP with STARTTLS instead of LDAPS
start_tls = false
# The value of an accepted TLS cipher. By default, this value is empty. Example value: [&amp;#34;TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384&amp;#34;])
# For a complete list of supported ciphers and TLS versions, refer to: https://go.dev/src/crypto/tls/cipher_suites.go
# Starting with Grafana v11.0 only ciphers with ECDHE support are accepted for TLS 1.2 connections.
tls_ciphers = []
# This is the minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1.1 (only for Grafana v10.4 or earlier), TLS1.2, TLS1.3.
min_tls_version = &amp;#34;&amp;#34;
# set to true if you want to skip SSL cert validation
ssl_skip_verify = false
# set to the path to your root CA certificate or leave unset to use system defaults
# root_ca_cert = &amp;#34;/path/to/certificate.crt&amp;#34;
# Authentication against LDAP servers requiring client certificates
# client_cert = &amp;#34;/path/to/client.crt&amp;#34;
# client_key = &amp;#34;/path/to/client.key&amp;#34;

# Search user bind dn
bind_dn = &amp;#34;cn=admin,dc=grafana,dc=org&amp;#34;
# Search user bind password
# If the password contains # or ; you have to wrap it with triple quotes. Ex &amp;#34;&amp;#34;&amp;#34;#password;&amp;#34;&amp;#34;&amp;#34;
bind_password = &amp;#34;grafana&amp;#34;
# We recommend using variable expansion for the bind_password, for more info https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#variable-expansion
# bind_password = &amp;#39;$__env{LDAP_BIND_PASSWORD}&amp;#39;

# Timeout in seconds. Applies to each host specified in the &amp;#39;host&amp;#39; entry (space separated).
timeout = 10

# User search filter, for example &amp;#34;(cn=%s)&amp;#34; or &amp;#34;(sAMAccountName=%s)&amp;#34; or &amp;#34;(uid=%s)&amp;#34;
# Allow login from email or username, example &amp;#34;(|(sAMAccountName=%s)(userPrincipalName=%s))&amp;#34;
search_filter = &amp;#34;(cn=%s)&amp;#34;

# An array of base dns to search through
search_base_dns = [&amp;#34;dc=grafana,dc=org&amp;#34;]

# group_search_filter = &amp;#34;(&amp;amp;(objectClass=posixGroup)(memberUid=%s))&amp;#34;
# group_search_filter_user_attribute = &amp;#34;distinguishedName&amp;#34;
# group_search_base_dns = [&amp;#34;ou=groups,dc=grafana,dc=org&amp;#34;]

# Specify names of the LDAP attributes your LDAP uses
[servers.attributes]
member_of = &amp;#34;memberOf&amp;#34;
email =  &amp;#34;email&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Whenever you modify the ldap.toml file, you must restart Grafana in order for the change(s) to take effect.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;using-the-grafana-user-interface&#34;&gt;Using the Grafana user interface&lt;/h3&gt;
&lt;p&gt;You can configure LDAP using the Grafana user interface by navigating to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; LDAP&lt;/strong&gt;. Please refer to the &lt;a href=&#34;../ldap-ui/&#34;&gt;LDAP user interface&lt;/a&gt; documentation for more information.&lt;/p&gt;
&lt;h3 id=&#34;using-environment-variables&#34;&gt;Using environment variables&lt;/h3&gt;
&lt;p&gt;You can interpolate variables in the TOML configuration from environment variables. For instance, you could externalize your &lt;code&gt;bind_password&lt;/code&gt; that way:&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;bind_password = &amp;#34;${LDAP_ADMIN_PASSWORD}&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;bind-and-bind-password&#34;&gt;Bind and bind password&lt;/h3&gt;
&lt;p&gt;By default the configuration expects you to specify a bind DN and bind password. This should be a read only user that can perform LDAP searches.
When the user DN is found a second bind is performed with the user provided username and password (in the normal Grafana login form).&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;bind_dn = &amp;#34;cn=admin,dc=grafana,dc=org&amp;#34;
bind_password = &amp;#34;grafana&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;single-bind-example&#34;&gt;Single bind example&lt;/h4&gt;
&lt;p&gt;If you can provide a single bind expression that matches all possible users, you can skip the second bind and bind against the user DN directly.
This allows you to not specify a bind_password in the 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;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;bind_dn = &amp;#34;cn=%s,o=users,dc=grafana,dc=org&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this case you skip providing a &lt;code&gt;bind_password&lt;/code&gt; and instead provide a &lt;code&gt;bind_dn&lt;/code&gt; value with a &lt;code&gt;%s&lt;/code&gt; somewhere. This will be replaced with the username entered in on the Grafana login page.
The search filter and search bases settings are still needed to perform the LDAP search to retrieve the other LDAP information (like LDAP groups and email).&lt;/p&gt;
&lt;h3 id=&#34;posix-schema&#34;&gt;POSIX schema&lt;/h3&gt;
&lt;p&gt;If your LDAP server does not support the &lt;code&gt;memberOf&lt;/code&gt; attribute, add the following options:&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;## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)
group_search_filter = &amp;#34;(&amp;amp;(objectClass=posixGroup)(memberUid=%s))&amp;#34;
## An array of the base DNs to search through for groups. Typically uses ou=groups
group_search_base_dns = [&amp;#34;ou=groups,dc=grafana,dc=org&amp;#34;]
## the %s in the search filter will be replaced with the attribute defined below
group_search_filter_user_attribute = &amp;#34;uid&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;group-mappings&#34;&gt;Group mappings&lt;/h3&gt;
&lt;p&gt;In &lt;code&gt;[[servers.group_mappings]]&lt;/code&gt; you can map an LDAP group to a Grafana organization and role. These will be synced every time the user logs in, with LDAP being the authoritative source.&lt;/p&gt;
&lt;p&gt;The first group mapping that an LDAP user is matched to will be used for the sync. If you have LDAP users that fit multiple mappings, the topmost mapping in the TOML configuration will be used.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LDAP specific configuration file (ldap.toml) example:&lt;/strong&gt;&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;[[servers]]
# other settings omitted for clarity

[[servers.group_mappings]]
group_dn = &amp;#34;cn=superadmins,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Admin&amp;#34;
grafana_admin = true

[[servers.group_mappings]]
group_dn = &amp;#34;cn=admins,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Admin&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;cn=users,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Editor&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;*&amp;#34;
org_role = &amp;#34;Viewer&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;group_dn&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;LDAP distinguished name (DN) of LDAP group. If you want to match all (or no LDAP groups) then you can use wildcard (&lt;code&gt;&amp;quot;*&amp;quot;&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;org_role&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Assign users of &lt;code&gt;group_dn&lt;/code&gt; the organization role &lt;code&gt;Admin&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, or &lt;code&gt;Viewer&lt;/code&gt;. The organization role name is case sensitive.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;org_id&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The Grafana organization database id. Setting this allows for multiple group_dn&amp;rsquo;s to be assigned to the same &lt;code&gt;org_role&lt;/code&gt; provided the &lt;code&gt;org_id&lt;/code&gt; differs&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1&lt;/code&gt; (default org id)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt; makes user of &lt;code&gt;group_dn&lt;/code&gt; Grafana server admin. A Grafana server admin has admin access over all organizations and users.&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;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;Commenting out a group mapping requires also commenting out the header of
said group or it will fail validation as an empty mapping.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;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;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;[[servers]]
# other settings omitted for clarity

[[servers.group_mappings]]
group_dn = &amp;#34;cn=superadmins,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Admin&amp;#34;
grafana_admin = true

# [[servers.group_mappings]]
# group_dn = &amp;#34;cn=admins,dc=grafana,dc=org&amp;#34;
# org_role = &amp;#34;Admin&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;cn=users,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Editor&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;nestedrecursive-group-membership&#34;&gt;Nested/recursive group membership&lt;/h3&gt;
&lt;p&gt;Users with nested/recursive group membership must have an LDAP server that supports &lt;code&gt;LDAP_MATCHING_RULE_IN_CHAIN&lt;/code&gt;
and configure &lt;code&gt;group_search_filter&lt;/code&gt; in a way that it returns the groups the submitted username is a member of.&lt;/p&gt;
&lt;p&gt;To configure &lt;code&gt;group_search_filter&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can set &lt;code&gt;group_search_base_dns&lt;/code&gt; to specify where the matching groups are defined.&lt;/li&gt;
&lt;li&gt;If you do not use &lt;code&gt;group_search_base_dns&lt;/code&gt;, then the previously defined &lt;code&gt;search_base_dns&lt;/code&gt; is used.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Active Directory example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Active Directory groups store the Distinguished Names (DNs) of members, so your filter needs to know the DN for the user based only on the submitted username.
Multiple DN templates are searched by combining filters with the LDAP OR-operator. Two 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;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;group_search_filter = &amp;#34;(member:1.2.840.113556.1.4.1941:=%s)&amp;#34;
group_search_base_dns = [&amp;#34;DC=mycorp,DC=mytld&amp;#34;]
group_search_filter_user_attribute = &amp;#34;dn&amp;#34;&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;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;group_search_filter = &amp;#34;(member:1.2.840.113556.1.4.1941:=CN=%s,[user container/OU])&amp;#34;
group_search_filter = &amp;#34;(|(member:1.2.840.113556.1.4.1941:=CN=%s,[user container/OU])(member:1.2.840.113556.1.4.1941:=CN=%s,[another user container/OU]))&amp;#34;
group_search_filter_user_attribute = &amp;#34;cn&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more information on AD searches refer to &lt;a href=&#34;https://docs.microsoft.com/en-us/windows/desktop/adsi/search-filter-syntax&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Microsoft&amp;rsquo;s Search Filter Syntax&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;For troubleshooting, changing &lt;code&gt;member_of&lt;/code&gt; in &lt;code&gt;[servers.attributes]&lt;/code&gt; to &amp;ldquo;dn&amp;rdquo; will show you more accurate group memberships when &lt;a href=&#34;#troubleshooting&#34;&gt;debug is enabled&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-examples&#34;&gt;Configuration examples&lt;/h2&gt;
&lt;p&gt;The following examples describe different LDAP configuration options.&lt;/p&gt;
&lt;h3 id=&#34;openldap&#34;&gt;OpenLDAP&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;http://www.openldap.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenLDAP&lt;/a&gt; is an open source directory service.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LDAP specific configuration file (ldap.toml):&lt;/strong&gt;&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;[[servers]]
host = &amp;#34;127.0.0.1&amp;#34;
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = &amp;#34;cn=admin,dc=grafana,dc=org&amp;#34;
bind_password = &amp;#34;grafana&amp;#34;
search_filter = &amp;#34;(cn=%s)&amp;#34;
search_base_dns = [&amp;#34;dc=grafana,dc=org&amp;#34;]

[servers.attributes]
member_of = &amp;#34;memberOf&amp;#34;
email =  &amp;#34;email&amp;#34;

# [[servers.group_mappings]] omitted for clarity&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;multiple-ldap-servers&#34;&gt;Multiple LDAP servers&lt;/h3&gt;
&lt;p&gt;Grafana does support receiving information from multiple LDAP servers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LDAP specific configuration file (ldap.toml):&lt;/strong&gt;&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;# --- First LDAP Server ---

[[servers]]
host = &amp;#34;10.0.0.1&amp;#34;
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = &amp;#34;cn=admin,dc=grafana,dc=org&amp;#34;
bind_password = &amp;#34;grafana&amp;#34;
search_filter = &amp;#34;(cn=%s)&amp;#34;
search_base_dns = [&amp;#34;ou=users,dc=grafana,dc=org&amp;#34;]

[servers.attributes]
member_of = &amp;#34;memberOf&amp;#34;
email =  &amp;#34;email&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;cn=admins,ou=groups,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Admin&amp;#34;
grafana_admin = true

# --- Second LDAP Server ---

[[servers]]
host = &amp;#34;10.0.0.2&amp;#34;
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false

bind_dn = &amp;#34;cn=admin,dc=grafana,dc=org&amp;#34;
bind_password = &amp;#34;grafana&amp;#34;
search_filter = &amp;#34;(cn=%s)&amp;#34;
search_base_dns = [&amp;#34;ou=users,dc=grafana,dc=org&amp;#34;]

[servers.attributes]
member_of = &amp;#34;memberOf&amp;#34;
email =  &amp;#34;email&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;cn=editors,ou=groups,dc=grafana,dc=org&amp;#34;
org_role = &amp;#34;Editor&amp;#34;

[[servers.group_mappings]]
group_dn = &amp;#34;*&amp;#34;
org_role = &amp;#34;Viewer&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;active-directory&#34;&gt;Active Directory&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;https://technet.microsoft.com/en-us/library/hh831484%28v=ws.11%29.aspx&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Active Directory&lt;/a&gt; is a directory service which is commonly used in Windows environments.&lt;/p&gt;
&lt;p&gt;Assuming the following Active Directory server setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IP address: &lt;code&gt;10.0.0.1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Domain: &lt;code&gt;CORP&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;DNS name: &lt;code&gt;corp.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;LDAP specific configuration file (ldap.toml):&lt;/strong&gt;&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;[[servers]]
host = &amp;#34;10.0.0.1&amp;#34;
port = 3269
use_ssl = true
start_tls = false
ssl_skip_verify = true
bind_dn = &amp;#34;CORP\\%s&amp;#34;
search_filter = &amp;#34;(sAMAccountName=%s)&amp;#34;
search_base_dns = [&amp;#34;dc=corp,dc=local&amp;#34;]

[servers.attributes]
member_of = &amp;#34;memberOf&amp;#34;
email =  &amp;#34;mail&amp;#34;

# [[servers.group_mappings]] omitted for clarity&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;port-requirements&#34;&gt;Port requirements&lt;/h4&gt;
&lt;p&gt;In the previous example, SSL is enabled and an encrypted port has been configured. If your Active Directory doesn&amp;rsquo;t support SSL, use &lt;code&gt;enable_ssl = false&lt;/code&gt; and &lt;code&gt;port = 389&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;Inspect your Active Directory configuration and documentation to find the correct settings. For more information about Active Directory and port requirements, refer to the &lt;a href=&#34;https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/service-overview-and-network-port-requirements#active-directory-local-security-authority&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Microsoft documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;To troubleshoot and get more log information, enable LDAP debug logging in the &lt;a href=&#34;../../../configure-grafana/&#34;&gt;&lt;code&gt;grafana.ini&lt;/code&gt; or &lt;code&gt;custom.ini&lt;/code&gt;&lt;/a&gt; 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;[log]
filters = ldap:debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-ldap-authentication">Configure LDAP authentication&lt;/h1>
&lt;p>The LDAP integration in Grafana allows your Grafana users to login with their LDAP credentials. You can also specify mappings between LDAP
group memberships and Grafana Organization user roles.&lt;/p></description></item><item><title>Configure LDAP authentication using the Grafana user interface</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/ldap-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/ldap-ui/</guid><content><![CDATA[&lt;h1 id=&#34;configure-ldap-authentication-using-the-grafana-user-interface&#34;&gt;Configure LDAP authentication using the Grafana user interface&lt;/h1&gt;
&lt;p&gt;This page explains how to configure LDAP authentication in Grafana using the Grafana user interface. For more detailed information about configuring LDAP authentication using the configuration file, refer to &lt;a href=&#34;../ldap/&#34;&gt;LDAP authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Benefits of using the Grafana user interface to configure LDAP authentication include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No need to edit the configuration file manually.&lt;/li&gt;
&lt;li&gt;Quickly test the connection to the LDAP server.&lt;/li&gt;
&lt;li&gt;No need to restart Grafana after making changes.&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;Any configuration changes made through the Grafana user interface (UI) will take precedence over settings specified in the Grafana configuration file or through environment variables. If you modify any configuration settings in the UI, they will override any corresponding settings set via environment variables or defined in the configuration file.&lt;/p&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;To follow these instructions, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Knowledge of LDAP authentication and how it works.&lt;/li&gt;
&lt;li&gt;A Grafana instance v11.3.0 or later.&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 &lt;code&gt;settings:auth.ldap:*&lt;/code&gt; scope.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;ssoSettingsLDAP&lt;/code&gt; feature toggle enabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;steps-to-configure-ldap-authentication&#34;&gt;Steps to configure LDAP authentication&lt;/h2&gt;
&lt;p&gt;Sign in to Grafana and navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; LDAP&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&#34;1-complete-mandatory-fields&#34;&gt;1. Complete mandatory fields&lt;/h3&gt;
&lt;p&gt;The mandatory fields have an asterisk (&lt;strong&gt;*&lt;/strong&gt;) next to them. Complete the following fields:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Server host&lt;/strong&gt;: Host name or IP address of the LDAP server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search filter&lt;/strong&gt;: The LDAP search filter finds entries within the directory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search base DNS&lt;/strong&gt;: List of base DNs to search through.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;2-complete-optional-fields&#34;&gt;2. Complete optional fields&lt;/h3&gt;
&lt;p&gt;Complete the optional fields as needed:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Bind DN&lt;/strong&gt;: Distinguished name (DN) of the user to bind to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bind password&lt;/strong&gt;: Password for the server.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;3-advanced-settings&#34;&gt;3. Advanced settings&lt;/h3&gt;
&lt;p&gt;Click the &lt;strong&gt;Edit&lt;/strong&gt; button in the &lt;strong&gt;Advanced settings&lt;/strong&gt; section to configure the following settings:&lt;/p&gt;
&lt;h4 id=&#34;1-miscellaneous-settings&#34;&gt;1. Miscellaneous settings&lt;/h4&gt;
&lt;p&gt;Complementary settings for LDAP authentication.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Allow sign-up&lt;/strong&gt;: Allows new users to register upon logging in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port&lt;/strong&gt;: Port number of the LDAP server. The default is 389.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt;: Time in seconds to wait for a response from the LDAP server.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;2-attributes&#34;&gt;2. Attributes&lt;/h4&gt;
&lt;p&gt;Attributes used to map LDAP user assertion to Grafana user attributes.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt;: Name of the assertion attribute to map to the Grafana user name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Surname&lt;/strong&gt;: Name of the assertion attribute to map to the Grafana user surname.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Username&lt;/strong&gt;: Name of the assertion attribute to map to the Grafana user username.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Member Of&lt;/strong&gt;: Name of the assertion attribute to map to the Grafana user membership.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Email&lt;/strong&gt;: Name of the assertion attribute to map to the Grafana user email.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;3-group-mapping&#34;&gt;3. Group mapping&lt;/h4&gt;
&lt;p&gt;Map LDAP groups to Grafana roles.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Skip organization role sync&lt;/strong&gt;: This option avoids syncing organization roles. It is useful when you want to manage roles manually.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Group search filter&lt;/strong&gt;: The LDAP search filter finds groups within the directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Group search base DNS&lt;/strong&gt;: List of base DNS to specify the matching groups&amp;rsquo; locations.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Group name attribute&lt;/strong&gt;: Identifies users within group entries.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manage group mappings&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;When managing group mappings, the following fields are available. To add a new group mapping, click the &lt;strong&gt;Add group mapping&lt;/strong&gt; button.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Add a group DN mapping&lt;/strong&gt;: The name of the key used to extract the ID token.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add an organization role mapping&lt;/strong&gt;: Select the Basic Role mapped to this group.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add the organization ID membership mapping&lt;/strong&gt;: Map the group to an organization ID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Define Grafana Admin membership&lt;/strong&gt;: Enable Grafana Admin privileges to the group.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;4-extra-security-settings&#34;&gt;4. Extra security settings&lt;/h4&gt;
&lt;p&gt;Additional security settings options for LDAP authentication.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Enable SSL&lt;/strong&gt;: This option will enable SSL to connect to the LDAP server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start TLS&lt;/strong&gt;: Use StartTLS to secure the connection to the LDAP server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Min TLS version&lt;/strong&gt;: Choose the minimum TLS version to use. TLS1.2 or TLS1.3&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS ciphers&lt;/strong&gt;: List the ciphers to use for the connection. For a complete list of ciphers, refer to the &lt;a href=&#34;https://go.dev/src/crypto/tls/cipher_suites.go&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Cipher Go library&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encryption key and certificate provision specification&lt;/strong&gt;:
This section allows you to specify the key and certificate for the LDAP server. You can provide the key and certificate in two ways: &lt;strong&gt;base-64&lt;/strong&gt; encoded or &lt;strong&gt;path to files&lt;/strong&gt;.
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Base-64 encoded certificate&lt;/strong&gt;:
All values used in this section must be base-64 encoded.
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Root CA certificate content&lt;/strong&gt;: List of root CA certificates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client certificate content&lt;/strong&gt;: Client certificate content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client key content&lt;/strong&gt;: Client key content.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Path to files&lt;/strong&gt;:
Path in the file system to the key and certificate files
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Root CA certificate path&lt;/strong&gt;: Path to the root CA certificate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client certificate path&lt;/strong&gt;: Path to the client certificate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client key path&lt;/strong&gt;: Path to the client key.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;4-persisting-the-configuration&#34;&gt;4. Persisting the configuration&lt;/h3&gt;
&lt;p&gt;Once you have configured the LDAP settings, click &lt;strong&gt;Save&lt;/strong&gt; to persist the configuration.&lt;/p&gt;
&lt;p&gt;If you want to delete all the changes made through the UI and revert to the configuration file settings, click the three dots menu icon and click &lt;strong&gt;Reset to default values&lt;/strong&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-ldap-authentication-using-the-grafana-user-interface">Configure LDAP authentication using the Grafana user interface&lt;/h1>
&lt;p>This page explains how to configure LDAP authentication in Grafana using the Grafana user interface. For more detailed information about configuring LDAP authentication using the configuration file, refer to &lt;a href="../ldap/">LDAP authentication&lt;/a>.&lt;/p></description></item><item><title>Configure enhanced LDAP integration</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/enhanced-ldap/</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/enhanced-ldap/</guid><content><![CDATA[&lt;h1 id=&#34;configure-enhanced-ldap-integration&#34;&gt;Configure enhanced LDAP integration&lt;/h1&gt;
&lt;p&gt;The enhanced LDAP integration adds additional functionality on top of the &lt;a href=&#34;../ldap/&#34;&gt;LDAP integration&lt;/a&gt; available in the open source edition of Grafana.&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;Available in &lt;a href=&#34;../../../../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;.
If you are a Grafana Cloud customer, please &lt;a href=&#34;/profile/org#support&#34;&gt;open a support ticket in the Cloud Portal&lt;/a&gt; to request this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;To control user access with role-based permissions, refer to &lt;a href=&#34;../../../../administration/roles-and-permissions/access-control/&#34;&gt;role-based access control&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;ldap-group-synchronization-for-teams&#34;&gt;LDAP group synchronization for teams&lt;/h2&gt;
&lt;p&gt;With enhanced LDAP integration, you can set up synchronization between LDAP groups and teams. This enables LDAP users that are members
of certain LDAP groups to automatically be added or removed as members to certain teams in Grafana.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/enterprise/team_members_ldap.png&#34;
  alt=&#34;LDAP group synchronization&#34; width=&#34;979&#34;
     height=&#34;382&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Grafana keeps track of all synchronized users in teams, and you can see which users have been synchronized from LDAP in the team members list, see &lt;code&gt;LDAP&lt;/code&gt; label in screenshot.
This mechanism allows Grafana to remove an existing synchronized user from a team when its LDAP group membership changes. This mechanism also allows you to manually add
a user as member of a team, and it will not be removed when the user signs in. This gives you flexibility to combine LDAP group memberships and Grafana team memberships.&lt;/p&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;div class=&#34;clearfix&#34;&gt;&lt;/div&gt;
&lt;h2 id=&#34;active-ldap-synchronization&#34;&gt;Active LDAP synchronization&lt;/h2&gt;
&lt;p&gt;In the open source version of Grafana, user data from LDAP is synchronized only during the login process when authenticating using LDAP.&lt;/p&gt;
&lt;p&gt;With active LDAP synchronization, you can configure Grafana to actively sync users with LDAP servers in the background. Only users that have logged into Grafana at least once are synchronized.&lt;/p&gt;
&lt;p&gt;Users with updated role and team membership will need to refresh the page to get access to the new features.&lt;/p&gt;
&lt;p&gt;Removed users are automatically logged out and their account disabled. These accounts are displayed in the &lt;strong&gt;Server Admin &amp;gt; Users&lt;/strong&gt; page with a &lt;code&gt;disabled&lt;/code&gt; label. Disabled users keep their custom permissions on dashboards, folders, and data sources, so if you add them back in your LDAP database, they have access to the application with the same custom permissions as before.&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;[auth.ldap]
...

# You can use the Cron syntax or several predefined schedulers -
# @yearly (or @annually) | Run once a year, midnight, Jan. 1st        | 0 0 1 1 *
# @monthly               | Run once a month, midnight, first of month | 0 0 1 * *
# @weekly                | Run once a week, midnight between Sat/Sun  | 0 0 * * 0
# @daily (or @midnight)  | Run once a day, midnight                   | 0 0 * * *
# @hourly                | Run once an hour, beginning of hour        | 0 * * * *
sync_cron = &amp;#34;0 1 * * *&amp;#34; # This is default value (At 1 am every day)
# This cron expression format uses 5 space-separated fields, for example
# sync_cron = &amp;#34;*/10 * * * *&amp;#34;
# This will run the LDAP Synchronization every 10th minute, which is also the minimal interval between the Grafana sync times i.e. you cannot set it for every 9th minute

# You can also disable active LDAP synchronization
active_sync_enabled = true # enabled by default&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Single bind configuration (as in the &lt;a href=&#34;../ldap/#single-bind-example&#34;&gt;Single bind example&lt;/a&gt;) is not supported with active LDAP synchronization because Grafana needs user information to perform LDAP searches.&lt;/p&gt;
&lt;p&gt;For the synchronization to work, the &lt;code&gt;servers.search_filter&lt;/code&gt; and &lt;code&gt;servers.attributes.username&lt;/code&gt; in the &lt;code&gt;ldap.toml&lt;/code&gt; configuration file must match. By default, the &lt;code&gt;servers.attributes.username&lt;/code&gt; is &lt;code&gt;cn&lt;/code&gt;, so if you use another attribute as the search filter, you must also update the username attribute.&lt;/p&gt;
&lt;p&gt;For example:&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;[[servers]]
search_filter = &amp;#34;(sAMAccountName=%s)&amp;#34;

[servers.attributes]
username  = &amp;#34;sAMAccountName&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If the attributes aren&amp;rsquo;t the same, the users&amp;rsquo; sessions will be terminated after each synchronization. That&amp;rsquo;s because the search will be done using the username&amp;rsquo;s value, and that value doesn&amp;rsquo;t exist for the attribute used in the search filter.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-enhanced-ldap-integration">Configure enhanced LDAP integration&lt;/h1>
&lt;p>The enhanced LDAP integration adds additional functionality on top of the &lt;a href="../ldap/">LDAP integration&lt;/a> available in the open source edition of Grafana.&lt;/p>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p></description></item><item><title>Configure SAML authentication in Grafana</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/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/</guid><content><![CDATA[&lt;h1 id=&#34;saml-authentication-in-grafana&#34;&gt;SAML authentication in Grafana&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;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The SAML authentication integration allows your Grafana users to log in by using an external SAML 2.0 Identity Provider (IdP). To enable this, Grafana becomes a Service Provider (SP) in the authentication flow, interacting with the IdP to exchange user information.&lt;/p&gt;
&lt;h2 id=&#34;set-up-options-for-saml-authentication-in-grafana&#34;&gt;Set up options for SAML authentication in Grafana&lt;/h2&gt;
&lt;p&gt;You can configure SAML authentication in Grafana with different methods. While the configuration options don&amp;rsquo;t change, if you want to keep all of Grafana authentication settings in one place, use the Grafana configuration file or the Terraform provider. If you&amp;rsquo;re a Grafana Cloud user, you don&amp;rsquo;t have access to Grafana configuration file. Instead, configure SAML through the other methods.&lt;/p&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;Configuration in the API or UI takes precedence over the configuration in the Grafana configuration file. SAML settings from the API will override any SAML configuration set in the Grafana configuration file.&lt;/p&gt;
&lt;p&gt;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;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The available methods are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Configure SAML using the 
    &lt;a href=&#34;/docs/grafana/v12.4/developers/http_api/sso-settings/&#34;&gt;SSO Settings API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Configure SAML using the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-ui/&#34;&gt;SAML user interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Configure SAML using the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-file/&#34;&gt;Grafana configuration file&lt;/a&gt; - &lt;strong&gt;not available in Grafana Cloud&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Configure SAML using the 
    &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;Grafana Terraform provider&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&amp;rsquo;re using Okta or Entra ID as Identity Provider, see the following documentation for configuration:&lt;/p&gt;
&lt;ul&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;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-okta/oin-application/&#34;&gt;Configure SAML with Okta catalog application&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;saml-bindings&#34;&gt;SAML bindings&lt;/h2&gt;
&lt;p&gt;Grafana supports the following SAML 2.0 bindings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;From the Service Provider (SP) to the Identity Provider (IdP):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HTTP-POST&lt;/code&gt; binding&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HTTP-Redirect&lt;/code&gt; binding&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the Identity Provider (IdP) to the Service Provider (SP):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HTTP-POST&lt;/code&gt; binding&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;request-initiation&#34;&gt;Request initiation&lt;/h2&gt;
&lt;p&gt;Grafana supports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SP-initiated requests&lt;/li&gt;
&lt;li&gt;IdP-initiated requests&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, SP-initiated requests are enabled. For instructions on how to enable IdP-initiated logins, see 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-file/#idp-initiated-single-sign-on-sso&#34;&gt;IdP-initiated Single Sign-On (SSO)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;identity-provider-idp-registration&#34;&gt;Identity provider (IdP) registration&lt;/h2&gt;
&lt;p&gt;For the SAML integration to work correctly, you need to make your IdP aware that Grafana is the SP.&lt;/p&gt;
&lt;p&gt;The integration provides two key endpoints as part of Grafana:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;/saml/metadata&lt;/code&gt; endpoint, which contains the SP metadata. You can either download and upload it manually, or you make the IdP request it directly from the endpoint. Some providers name it Identifier or Entity ID.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;/saml/acs&lt;/code&gt; endpoint, which is intended to receive the ACS (Assertion Customer Service) callback. Some providers name it SSO URL or Reply URL.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;idp-metadata&#34;&gt;IdP metadata&lt;/h3&gt;
&lt;p&gt;You also need to define the public part of the IdP for message verification. The SAML IdP metadata XML defines where and how Grafana exchanges user information.&lt;/p&gt;
&lt;p&gt;Grafana supports three ways of specifying the IdP metadata.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Without a suffix &lt;code&gt;idp_metadata&lt;/code&gt;, Grafana assumes base64-encoded XML file contents.&lt;/li&gt;
&lt;li&gt;With the &lt;code&gt;_path&lt;/code&gt; suffix, Grafana assumes a path and attempts to read the file from the file system.&lt;/li&gt;
&lt;li&gt;With the &lt;code&gt;_url&lt;/code&gt; suffix, Grafana assumes a URL and attempts to load the metadata from the given location.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;assertion-mapping&#34;&gt;Assertion mapping&lt;/h2&gt;
&lt;p&gt;During the SAML SSO authentication flow, Grafana receives the ACS callback. The callback contains all the relevant information of the user under authentication embedded in the SAML response. Grafana parses the response to create (or update) the user within its internal database.&lt;/p&gt;
&lt;p&gt;For Grafana to map the user information, it looks at the individual attributes within the assertion. You can think of these attributes as Key/Value pairs (although, they contain more information than that).&lt;/p&gt;
&lt;p&gt;Grafana provides configuration options that let you modify which keys to look at for these values. The data we need to create the user in Grafana is Name, Login handle, and email.&lt;/p&gt;
&lt;h2 id=&#34;integrate-with-scim-provisioning&#34;&gt;Integrate with SCIM Provisioning&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re also using SCIM provisioning for this Grafana application in Entra ID, it&amp;rsquo;s crucial to align the user identifiers between SAML and SCIM for seamless operation. The unique identifier that links the SAML user to the SCIM provisioned user is determined by the &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; setting in the Grafana SAML configuration. This &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; should correspond to the &lt;code&gt;externalId&lt;/code&gt; used in SCIM provisioning (typically set to the Entra ID &lt;code&gt;user.objectid&lt;/code&gt;).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Ensure Consistent Identifier in SAML Assertion:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The unique identifier from Entra ID (typically &lt;code&gt;user.objectid&lt;/code&gt;) that you mapped to the &lt;code&gt;externalId&lt;/code&gt; attribute in Grafana in your SCIM provisioning setup &lt;strong&gt;must also be sent as a claim in the SAML assertion.&lt;/strong&gt; For more details on SCIM, refer to the 
    &lt;a href=&#34;https://www.grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SCIM provisioning documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the Entra ID Enterprise Application, under &lt;strong&gt;Single sign-on&lt;/strong&gt; &amp;gt; &lt;strong&gt;Attributes &amp;amp; Claims&lt;/strong&gt;, ensure you add a claim that provides this identifier. For example, you might add a claim named &lt;code&gt;UserID&lt;/code&gt; (or similar, like &lt;code&gt;externalId&lt;/code&gt;) that sources its value from &lt;code&gt;user.objectid&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Grafana SAML Settings for SCIM:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the &lt;code&gt;[auth.saml]&lt;/code&gt; section of your Grafana configuration, set &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; to the name of the SAML claim you configured in the previous step (e.g., &lt;code&gt;userUID&lt;/code&gt; or the full URI like &lt;code&gt;http://schemas.microsoft.com/identity/claims/objectidentifier&lt;/code&gt; if that&amp;rsquo;s how Entra ID sends it).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;assertion_attribute_login&lt;/code&gt; setting should still be configured to map to the attribute your users will log in with (e.g., &lt;code&gt;userPrincipalName&lt;/code&gt;, &lt;code&gt;mail&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Example Grafana Configuration:&lt;/em&gt;&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]
# ... other SAML settings ...
assertion_attribute_login = http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier # Or other login attribute
assertion_attribute_external_uid = http://schemas.microsoft.com/identity/claims/objectidentifier # Or your custom claim name for user.objectid&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Ensure that the value specified in &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; precisely matches the name of the claim as it&amp;rsquo;s sent in the SAML assertion from Entra ID.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SCIM Linking Identifier and Entra ID:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By default (if &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; is not set), Grafana uses the &lt;code&gt;userUID&lt;/code&gt; attribute from the SAML assertion for SCIM linking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recommended for Entra ID:&lt;/strong&gt; For SCIM integration with Entra ID, it is necessary to:
&lt;ol&gt;
&lt;li&gt;Ensure Entra ID sends the &lt;code&gt;user.objectid&lt;/code&gt; in a claim.&lt;/li&gt;
&lt;li&gt;Either set this claim name in Entra ID to &lt;code&gt;userUID&lt;/code&gt;, or, if you want to use a different claim name, set &lt;code&gt;assertion_attribute_external_uid&lt;/code&gt; in Grafana to match the claim name you chose in Entra ID.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;advanced-configuration&#34;&gt;Advanced configuration&lt;/h2&gt;
&lt;p&gt;For advanced configuration and troubleshooting, refer to the one of the following pages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/configure-saml-signing-encryption/&#34;&gt;Configure SAML request signing&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-single-logout/&#34;&gt;Configure SAML single logout&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-org-mapping/&#34;&gt;Configure Organization mapping&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-team-role-mapping/&#34;&gt;Configure Role and Team sync&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/saml-configuration-options/&#34;&gt;SAML configuration options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/saml/troubleshoot-saml/&#34;&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="saml-authentication-in-grafana">SAML authentication in Grafana&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;/blockquote>&lt;/div>
&lt;p>The SAML authentication integration allows your Grafana users to log in by using an external SAML 2.0 Identity Provider (IdP). To enable this, Grafana becomes a Service Provider (SP) in the authentication flow, interacting with the IdP to exchange user information.&lt;/p></description></item><item><title>Configure Generic OAuth authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/generic-oauth/</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/generic-oauth/</guid><content><![CDATA[&lt;h1 id=&#34;configure-generic-oauth-authentication&#34;&gt;Configure Generic OAuth authentication&lt;/h1&gt;


&lt;div data-shared=&#34;auth/intro.md&#34;&gt;
            &lt;p&gt;There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p&gt;
&lt;p&gt;When deciding on an authentication method, it&amp;rsquo;s important to take into account your current identity and access management system as well as the specific authentication and authorization features you require.
For a complete list of the available authentication options and the features they support, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/&#34;&gt;Configure authentication&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;

        
&lt;p&gt;Grafana provides OAuth2 integrations for the following auth providers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../azuread/&#34;&gt;Entra ID OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../github/&#34;&gt;GitHub OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../gitlab/&#34;&gt;GitLab OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../google/&#34;&gt;Google OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../grafana-cloud/&#34;&gt;Grafana Com OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../keycloak/&#34;&gt;Keycloak OAuth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../okta/&#34;&gt;Okta OAuth&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If your OAuth2 provider is not listed, you can use Generic OAuth authentication.&lt;/p&gt;
&lt;p&gt;This topic describes how to configure Generic OAuth authentication using different methods and includes &lt;a href=&#34;#examples-of-setting-up-generic-oauth&#34;&gt;examples of setting up Generic OAuth&lt;/a&gt; with specific OAuth2 providers.&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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you know how to create an OAuth2 application with your OAuth2 provider. Consult the documentation of your OAuth2 provider for more information.&lt;/li&gt;
&lt;li&gt;Ensure your identity provider returns OpenID UserInfo compatible information such as the &lt;code&gt;sub&lt;/code&gt; claim.&lt;/li&gt;
&lt;li&gt;If you are using refresh tokens, ensure you know how to set them up with your OAuth2 provider. Consult the documentation of your OAuth2 provider for more information.&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;If Users use the same email address in Entra ID that they use with other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;configure-generic-oauth-authentication-client-using-the-grafana-ui&#34;&gt;Configure generic OAuth authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;As a Grafana Admin, you can configure Generic OAuth client from within Grafana using the Generic OAuth UI. To do this, navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; Generic OAuth&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file then the form will be pre-populated with those values otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt; to save the configuration. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes you made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h2 id=&#34;configure-generic-oauth-authentication-client-using-the-terraform-provider&#34;&gt;Configure generic OAuth authentication client using the Terraform provider&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;generic_sso_settings&amp;#34; {
  provider_name = &amp;#34;generic_oauth&amp;#34;
  oauth2_settings {
    name              = &amp;#34;Auth0&amp;#34;
    auth_url          = &amp;#34;https://&amp;lt;domain&amp;gt;/authorize&amp;#34;
    token_url         = &amp;#34;https://&amp;lt;domain&amp;gt;/oauth/token&amp;#34;
    api_url           = &amp;#34;https://&amp;lt;domain&amp;gt;/userinfo&amp;#34;
    client_id         = &amp;#34;&amp;lt;client id&amp;gt;&amp;#34;
    client_secret     = &amp;#34;&amp;lt;client secret&amp;gt;&amp;#34;
    allow_sign_up     = true
    auto_login        = false
    scopes            = &amp;#34;openid profile email offline_access&amp;#34;
    use_pkce          = true
    use_refresh_token = true
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/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;
&lt;h2 id=&#34;configure-generic-oauth-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure generic OAuth authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;p&gt;To integrate your OAuth2 provider with Grafana using our Generic OAuth authentication, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an OAuth2 application in your chosen OAuth2 provider.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the callback URL for your OAuth2 app to &lt;code&gt;http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/login/generic_oauth&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Ensure that the callback URL is the complete HTTP address that you use to access Grafana via your browser, but with the appended path of &lt;code&gt;/login/generic_oauth&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For the callback URL to be correct, it might be necessary to set the &lt;code&gt;root_url&lt;/code&gt; option in the &lt;code&gt;[server]&lt;/code&gt;section of the Grafana configuration file. For example, if you are serving Grafana behind a proxy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the following table to update field values located in the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file:&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;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;client_secret&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;These values must match the client ID and client secret from your OAuth2 app.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The authorization endpoint of your OAuth2 provider.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The user information endpoint of your OAuth2 provider. Information returned by this endpoint must be compatible with &lt;a href=&#34;https://connect2id.com/products/server/docs/api/userinfo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenID UserInfo&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enables Generic OAuth authentication. Set this value to &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Review the list of other Generic OAuth &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; and complete them, as necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;a href=&#34;#configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;a. Extend the &lt;code&gt;scopes&lt;/code&gt; field of &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section in Grafana configuration file with refresh token scope used by your OAuth2 provider.&lt;/p&gt;
&lt;p&gt;b. Set &lt;code&gt;use_refresh_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section in Grafana configuration file.&lt;/p&gt;
&lt;p&gt;c. Enable the refresh token on the provider if required.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team synchronization&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart Grafana.&lt;/p&gt;
&lt;p&gt;You should now see a Generic OAuth login button on the login page and be able to log in or sign up with your OAuth2 provider.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-login&#34;&gt;Configure login&lt;/h3&gt;
&lt;p&gt;Grafana can resolve a user&amp;rsquo;s login from the OAuth2 ID token, user information retrieved from the OAuth2 UserInfo endpoint, or the OAuth2 access token.
Grafana looks at these sources in the order listed until it finds a login.
If no login is found, then the user&amp;rsquo;s login is set to user&amp;rsquo;s email address.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-important&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Important&lt;/p&gt;&lt;p&gt;Email is required for successful sign-up and login with Generic OAuth. Even if you map &lt;code&gt;login&lt;/code&gt; from another claim (for example &lt;code&gt;sub&lt;/code&gt;), Grafana still requires the user to have an email. Ensure your provider returns an email claim or configure &lt;code&gt;email_attribute_path&lt;/code&gt; so Grafana can resolve it. Including the &lt;code&gt;email&lt;/code&gt; scope is strongly recommended (for OIDC providers use &lt;code&gt;openid profile email&lt;/code&gt;).&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to the following table for information on what to configure based on how your Oauth2 provider returns a user&amp;rsquo;s login:&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;Source of login&lt;/th&gt;
              &lt;th&gt;Required configuration&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;login&lt;/code&gt; or &lt;code&gt;username&lt;/code&gt; field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;login_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;login&lt;/code&gt; or &lt;code&gt;username&lt;/code&gt; field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;login_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;login&lt;/code&gt; or &lt;code&gt;username&lt;/code&gt; field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;login_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;use-the-sub-claim-for-login&#34;&gt;Use the &lt;code&gt;sub&lt;/code&gt; claim for login&lt;/h4&gt;
&lt;p&gt;Most of the OAuth2 providers expose a stable subject identifier in the &lt;code&gt;sub&lt;/code&gt; claim. You can use it to populate the Grafana login by setting &lt;code&gt;login_attribute_path&lt;/code&gt; to &lt;code&gt;sub&lt;/code&gt;. Because email is still required, also make sure Grafana can resolve the user&amp;rsquo;s email (for example by including the &lt;code&gt;email&lt;/code&gt; scope or mapping a custom field via &lt;code&gt;email_attribute_path&lt;/code&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.generic_oauth]
enabled = true
scopes = openid profile email
login_attribute_path = sub
# If your provider does not return `email` at the top level, map it explicitly
# email_attribute_path = user.email&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-display-name&#34;&gt;Configure display name&lt;/h3&gt;
&lt;p&gt;Grafana can resolve a user&amp;rsquo;s display name from the OAuth2 ID token, user information retrieved from the OAuth2 UserInfo endpoint, or the OAuth2 access token.
Grafana looks at these sources in the order listed until it finds a display name.
If no display name is found, then user&amp;rsquo;s login is displayed instead.&lt;/p&gt;
&lt;p&gt;Refer to the following table for information on what you need to configure depending on how your Oauth2 provider returns a user&amp;rsquo;s name:&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;Source of display name&lt;/th&gt;
              &lt;th&gt;Required configuration&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name&lt;/code&gt; or &lt;code&gt;display_name&lt;/code&gt; field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;name_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name&lt;/code&gt; or &lt;code&gt;display_name&lt;/code&gt; field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;name_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name&lt;/code&gt; or &lt;code&gt;display_name&lt;/code&gt; field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;name_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-email-address&#34;&gt;Configure email address&lt;/h3&gt;
&lt;p&gt;Grafana can resolve the user&amp;rsquo;s email address from the OAuth2 ID token, the user information retrieved from the OAuth2 UserInfo endpoint, the OAuth2 access token, or the OAuth2 &lt;code&gt;/emails&lt;/code&gt; endpoint.
Grafana looks at these sources in the order listed until an email address is found.
If no email is found, then the email address of the user is set to an empty string.&lt;/p&gt;
&lt;p&gt;Refer to the following table for information on what to configure based on how the Oauth2 provider returns a user&amp;rsquo;s email address:&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;Source of email address&lt;/th&gt;
              &lt;th&gt;Required configuration&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;email&lt;/code&gt; field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;attributes&lt;/code&gt; map of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;email_attribute_name&lt;/code&gt; configuration option. By default, Grafana searches for email under &lt;code&gt;email:primary&lt;/code&gt; key.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;upn&lt;/code&gt; field of the OAuth2 ID token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;email&lt;/code&gt; field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the user information from the UserInfo endpoint.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;email_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;email&lt;/code&gt; field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;attributes&lt;/code&gt; map of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;email_attribute_name&lt;/code&gt; configuration option. By default, Grafana searches for email under &lt;code&gt;email:primary&lt;/code&gt; key.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;upn&lt;/code&gt; field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Another field of the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;Set &lt;code&gt;email_attribute_path&lt;/code&gt; configuration option.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Email address marked as primary from the &lt;code&gt;/emails&lt;/code&gt; endpoint of &lt;br /&gt; the OAuth2 provider (obtained by appending &lt;code&gt;/emails&lt;/code&gt; to the URL &lt;br /&gt; configured with &lt;code&gt;api_url&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;N/A&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/h3&gt;
&lt;p&gt;When a user logs in using an OAuth2 provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token.&lt;/p&gt;
&lt;p&gt;Grafana uses a refresh token to obtain a new access token without requiring the user to log in again. If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;To configure Generic OAuth to use a refresh token, set &lt;code&gt;use_refresh_token&lt;/code&gt; configuration option to &lt;code&gt;true&lt;/code&gt; and perform one or both of the following steps, if required:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Extend the &lt;code&gt;scopes&lt;/code&gt; field of &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section in Grafana configuration file with additional scopes.&lt;/li&gt;
&lt;li&gt;Enable the refresh token on the provider.&lt;/li&gt;
&lt;/ol&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 &lt;code&gt;accessTokenExpirationCheck&lt;/code&gt; feature toggle has been removed in Grafana v10.3.0 and the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value will be used instead for configuring refresh token fetching and access token expiration check.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-jwt-id-token-validation&#34;&gt;Configure JWT ID token validation&lt;/h3&gt;
&lt;p&gt;By default, Grafana extracts user information from ID tokens without validating their cryptographic signatures. To enhance security, you can enable JWT signature validation to ensure that ID tokens are authentic and have not been tampered with.&lt;/p&gt;
&lt;p&gt;To enable JWT ID token validation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set &lt;code&gt;validate_id_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;code&gt;jwk_set_url&lt;/code&gt; with the URL of your OAuth2 provider&amp;rsquo;s JSON Web Key Set (JWKS) endpoint. This endpoint provides the public keys used to verify JWT signatures.&lt;/p&gt;
&lt;p&gt;Common JWKS endpoint locations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OIDC providers: &lt;code&gt;https://&amp;lt;provider-domain&amp;gt;/.well-known/jwks.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Auth0: &lt;code&gt;https://&amp;lt;tenant&amp;gt;.auth0.com/.well-known/jwks.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Keycloak: &lt;code&gt;https://&amp;lt;keycloak-domain&amp;gt;/realms/&amp;lt;realm&amp;gt;/.well-known/openid-configuration&lt;/code&gt; (contains &lt;code&gt;jwks_uri&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&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.generic_oauth]
enabled = true
validate_id_token = true
jwk_set_url = https://your-provider.com/.well-known/jwks.json
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
auth_url = https://your-provider.com/authorize
token_url = https://your-provider.com/token
api_url = https://your-provider.com/userinfo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;When JWT validation is enabled, Grafana caches the JWKS keys to improve performance. The cache respects the &lt;code&gt;Cache-Control&lt;/code&gt; header from the JWKS endpoint response. If no cache expiration is specified, keys are cached for 5 minutes by default.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;If &lt;code&gt;validate_id_token&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt;, you must configure &lt;code&gt;jwk_set_url&lt;/code&gt;. Authentication will fail if the JWK Set URL is not provided or if the ID token signature cannot be verified.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h3&gt;
&lt;p&gt;Unless &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role retrieved from the auth provider upon user login.&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option.
Grafana will first evaluate the expression using the OAuth2 ID token. If no role is found, the expression will be evaluated using the user information obtained from the UserInfo endpoint. If still no role is found, the expression will be evaluated using the OAuth2 access token.
To map the server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.
Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_attribute_path&lt;/code&gt; and &lt;code&gt;org_mapping&lt;/code&gt; configuration options to assign the user to organizations and specify their role. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If both org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) and the regular role mapping (&lt;code&gt;role_attribute_path&lt;/code&gt;) are specified, then the user will get the highest of the two mapped roles.&lt;/p&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, go to &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; to test and evaluate expressions with custom payloads.&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;When using &lt;code&gt;org_attribute_path&lt;/code&gt;, the value returned by the JMESPath expression must be an array, not a string.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;role-mapping-examples&#34;&gt;Role mapping examples&lt;/h4&gt;
&lt;p&gt;This section includes examples of JMESPath expressions used for role mapping.&lt;/p&gt;
&lt;h5 id=&#34;map-user-organization-role&#34;&gt;Map user organization role&lt;/h5&gt;
&lt;p&gt;In this example, the user has been granted the role of an &lt;code&gt;Editor&lt;/code&gt;. The role assigned is based on the value of the property &lt;code&gt;role&lt;/code&gt;, which must be a valid Grafana role such as &lt;code&gt;Admin&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt; or &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Payload:&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;role&amp;#34;: &amp;#34;Editor&amp;#34;,
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Config:&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;role_attribute_path = role&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the following more complex example, the user has been granted the &lt;code&gt;Admin&lt;/code&gt; role. This is because they are a member of the &lt;code&gt;admin&lt;/code&gt; group of their OAuth2 provider.
If the user was a member of the &lt;code&gt;editor&lt;/code&gt; group, they would be granted the &lt;code&gt;Editor&lt;/code&gt; role, otherwise &lt;code&gt;Viewer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Payload:&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;groups&amp;#34;: [
        &amp;#34;engineer&amp;#34;,
        &amp;#34;admin&amp;#34;,
    ],
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Config:&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;role_attribute_path = contains(groups[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(groups[*], &amp;#39;editor&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-server-administrator-role&#34;&gt;Map server administrator role&lt;/h5&gt;
&lt;p&gt;In the following example, the user is granted the Grafana server administrator role.&lt;/p&gt;
&lt;p&gt;Payload:&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;roles&amp;#34;: [
        &amp;#34;admin&amp;#34;,
    ],
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Config:&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;role_attribute_path = contains(roles[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || contains(roles[*], &amp;#39;editor&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;
allow_assign_grafana_admin = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-one-role-to-all-users&#34;&gt;Map one role to all users&lt;/h5&gt;
&lt;p&gt;In this example, all users will be assigned &lt;code&gt;Viewer&lt;/code&gt; role regardless of the user information received from the identity provider.&lt;/p&gt;
&lt;p&gt;Config:&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;role_attribute_path = &amp;#34;&amp;#39;Viewer&amp;#39;&amp;#34;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h4&gt;
&lt;p&gt;In this example, the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; org, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; orgs.&lt;/p&gt;
&lt;p&gt;If the user was a member of the &lt;code&gt;admin&lt;/code&gt; group, they would be granted the Grafana server administrator role.&lt;/p&gt;
&lt;p&gt;Payload:&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;roles&amp;#34;: [&amp;#34;org_foo&amp;#34;, &amp;#34;org_bar&amp;#34;, &amp;#34;another_org&amp;#34;]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Config:&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;role_attribute_path = contains(roles[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;None&amp;#39;
allow_assign_grafana_admin = true
org_attribute_path = roles
org_mapping = org_foo:org_foo:Viewer org_bar:org_bar:Editor *:org_baz:Editor&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-team-synchronization&#34;&gt;Configure team synchronization&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;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;By using Team Sync, you can link your OAuth2 groups to teams within Grafana. This will automatically assign users to the appropriate teams.
Teams for each user are synchronized when the user logs in.&lt;/p&gt;
&lt;p&gt;Generic OAuth groups can be referenced by group ID, such as &lt;code&gt;8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt; or &lt;code&gt;myteam&lt;/code&gt;.
Group information can be extracted from the OAuth2 ID token, user information from the UserInfo endpoint, or the OAuth2 access token.
For information on configuring OAuth2 groups with Grafana using the &lt;code&gt;groups_attribute_path&lt;/code&gt; configuration option, refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To learn more about Team Sync, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team sync&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;team-synchronization-example&#34;&gt;Team synchronization example&lt;/h3&gt;
&lt;p&gt;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;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;groups_attribute_path = groups&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Payload:&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;groups&amp;#34;: [
        &amp;#34;engineers&amp;#34;,
        &amp;#34;analysts&amp;#34;,
    ],
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table outlines the various Generic OAuth configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with environment variables&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;If the configuration option requires a JMESPath expression that includes a colon, enclose the entire expression in quotes to prevent parsing errors. For example &lt;code&gt;role_attribute_path: &amp;quot;role:view&amp;quot;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Enables Generic OAuth authentication.&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;Yes&lt;/td&gt;
              &lt;td&gt;Name that refers to the Generic OAuth authentication from the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;OAuth&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for the Generic OAuth authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;signin&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID provided by your OAuth2 app.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret provided by your OAuth2 app.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of your OAuth2 provider.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain user information compatible with &lt;a href=&#34;https://connect2id.com/products/server/docs/api/userinfo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenID UserInfo&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_style&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Name of the &lt;a href=&#34;https://pkg.go.dev/golang.org/x/oauth2#AuthStyle&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OAuth2 AuthStyle&lt;/a&gt; to be used when ID token is requested from OAuth2 provider. It determines how &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;client_secret&lt;/code&gt; are sent to Oauth2 provider. Available values are &lt;code&gt;AutoDetect&lt;/code&gt;, &lt;code&gt;InParams&lt;/code&gt; and &lt;code&gt;InHeader&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;AutoDetect&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated OAuth2 scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;user:email&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;empty_scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use an empty scope during authentication.&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;Yes&lt;/td&gt;
              &lt;td&gt;Controls Grafana user creation through the Generic OAuth login. Only existing Grafana users can log in with Generic OAuth if set to &lt;code&gt;false&lt;/code&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;login_prompt&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Indicates the type of user interaction when the user logs in with the IdP. Available values are &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;consent&lt;/code&gt; and &lt;code&gt;select_account&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;id_token_attribute_name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The name of the key used to extract the ID token from the returned OAuth2 token.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;id_token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;login_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for user login lookup from the user ID token. For more information on how user login is retrieved, refer to &lt;a href=&#34;#configure-login&#34;&gt;Configure login&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;name_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for user name lookup from the user ID token. This name will be used as the user&amp;rsquo;s display name. For more information on how user display name is retrieved, refer to &lt;a href=&#34;#configure-display-name&#34;&gt;Configure display name&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;email_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for user email lookup from the user information. For more information on how user email is retrieved, refer to &lt;a href=&#34;#configure-email-address&#34;&gt;Configure email address&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;email_attribute_name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Name of the key to use for user email lookup within the &lt;code&gt;attributes&lt;/code&gt; map of OAuth2 ID token. For more information on how user email is retrieved, refer to &lt;a href=&#34;#configure-email-address&#34;&gt;Configure email address&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;email:primary&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana role lookup. Grafana will first evaluate the expression using the OAuth2 ID token. If no role is found, the expression will be evaluated using the user information obtained from the UserInfo endpoint. If still no role is found, the expression will be evaluated using the OAuth2 access token. The result of the evaluation should be a valid Grafana role (&lt;code&gt;None&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Admin&lt;/code&gt; or &lt;code&gt;GrafanaAdmin&lt;/code&gt;). For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana org role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt; or &lt;code&gt;org_mapping&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;skip_org_role_sync&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles. This will allow you to set organization roles for your users from within Grafana manually.&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;org_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana org to role lookup. Grafana will first evaluate the expression using the OAuth2 ID token. If no value is returned, the expression will be evaluated using the user information obtained from the UserInfo endpoint. If still no value is returned, the expression will be evaluated using the OAuth2 access token. The result of the evaluation will be mapped to org roles based on &lt;code&gt;org_mapping&lt;/code&gt;. For more information on org to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalOrgName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allow_assign_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable automatic sync of the Grafana server administrator role. If this option is set to &lt;code&gt;true&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user the server administrator privileges and organization administrator role. If this option is set to &lt;code&gt;false&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user only organization administrator role. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;groups_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for user group lookup. Grafana will first evaluate the expression using the OAuth2 ID token. If no groups are found, the expression will be evaluated using the user information obtained from the UserInfo endpoint. If still no groups are found, the expression will be evaluated using the OAuth2 access token. The result of the evaluation should be a string array of groups.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated groups. The user should be a member of at least one group to log in. If you configure &lt;code&gt;allowed_groups&lt;/code&gt;, you must also configure &lt;code&gt;groups_attribute_path&lt;/code&gt;.&lt;/td&gt;
              &lt;td&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;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated organizations. The 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;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated domains. The user should belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;team_ids&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;String list of team IDs. If set, the user must be a member of one of the given teams to log in. If you configure &lt;code&gt;team_ids&lt;/code&gt;, you must also configure &lt;code&gt;teams_url&lt;/code&gt; and &lt;code&gt;team_ids_attribute_path&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;team_ids_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana team ID lookup within the results returned by the &lt;code&gt;teams_url&lt;/code&gt; endpoint.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;teams_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The URL used to query for team IDs. If not set, the default value is &lt;code&gt;/teams&lt;/code&gt;. If you configure &lt;code&gt;teams_url&lt;/code&gt;, you must also configure &lt;code&gt;team_ids_attribute_path&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt;, the client accepts any certificate presented by the server and any host name in that certificate. &lt;em&gt;You should only use this for testing&lt;/em&gt;, because this mode leaves SSL/TLS susceptible to man-in-the-middle attacks.&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;tls_client_cert&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_key&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_ca&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the trusted certificate authority list.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;use_pkce&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Proof Key for Code Exchange (PKCE)&lt;/a&gt;. Grafana uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&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;use_refresh_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use refresh token and check access token expiration.&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;validate_id_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable JWT signature validation for ID tokens. When enabled, &lt;code&gt;jwk_set_url&lt;/code&gt; must be configured.&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;jwk_set_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL of the JSON Web Key Set (JWKS) endpoint used to verify JWT ID token signatures. Required when &lt;code&gt;validate_id_token&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;examples-of-setting-up-generic-oauth&#34;&gt;Examples of setting up Generic OAuth&lt;/h2&gt;
&lt;p&gt;This section includes examples of setting up Generic OAuth integration.&lt;/p&gt;
&lt;h3 id=&#34;set-up-oauth2-with-descope&#34;&gt;Set up OAuth2 with Descope&lt;/h3&gt;
&lt;p&gt;To set up Generic OAuth authentication with Descope, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a Descope Project &lt;a href=&#34;https://app.descope.com/gettingStarted&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;, and go through the Getting Started Wizard to configure your authentication. You can skip step if you already have Descope project set up.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you wish to use a flow besides &lt;code&gt;Sign Up or In&lt;/code&gt;, go to the &lt;strong&gt;IdP Applications&lt;/strong&gt; menu in the console, and select your IdP application. Then alter the &lt;strong&gt;Flow Hosting URL&lt;/strong&gt; query parameter &lt;code&gt;?flow=sign-up-or-in&lt;/code&gt; to change which flow id you wish to use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file using the values from the &lt;strong&gt;Settings&lt;/strong&gt; tab:&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;You can get your Client ID (Descope Project ID) under &lt;a href=&#34;https://app.descope.com/settings/project&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Project Settings&lt;/a&gt;. Your Client Secret (Descope Access Key) can be generated under &lt;a href=&#34;https://app.descope.com/accesskeys&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Access Keys&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&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;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;[auth.generic_oauth]
enabled = true
allow_sign_up = true
auto_login = false
team_ids =
allowed_organizations =
name = Descope
client_id = &amp;lt;Descope Project ID&amp;gt;
client_secret = &amp;lt;Descope Access Key&amp;gt;
scopes = openid profile email descope.claims descope.custom_claims
auth_url = https://api.descope.com/oauth2/v1/authorize
token_url = https://api.descope.com/oauth2/v1/token
api_url = https://api.descope.com/oauth2/v1/userinfo
use_pkce = true
use_refresh_token = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-up-oauth2-with-auth0&#34;&gt;Set up OAuth2 with Auth0&lt;/h3&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;Support for the Auth0 &amp;ldquo;audience&amp;rdquo; feature is not currently available in Grafana. For roles and permissions, the available options are described &lt;a href=&#34;../../../../administration/roles-and-permissions/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To set up Generic OAuth authentication with Auth0, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an Auth0 application using the following parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: Grafana&lt;/li&gt;
&lt;li&gt;Type: Regular Web Application&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to the &lt;strong&gt;Settings&lt;/strong&gt; tab of the application and set &lt;strong&gt;Allowed Callback URLs&lt;/strong&gt; to &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;/login/generic_oauth&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save Changes&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file using the values from the &lt;strong&gt;Settings&lt;/strong&gt; tab:&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;[auth.generic_oauth]
enabled = true
allow_sign_up = true
auto_login = false
team_ids =
allowed_organizations =
name = Auth0
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid profile email offline_access
auth_url = https://&amp;lt;domain&amp;gt;/authorize
token_url = https://&amp;lt;domain&amp;gt;/oauth/token
api_url = https://&amp;lt;domain&amp;gt;/userinfo
use_pkce = true
use_refresh_token = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-up-oauth2-with-bitbucket&#34;&gt;Set up OAuth2 with Bitbucket&lt;/h3&gt;
&lt;p&gt;To set up Generic OAuth authentication with Bitbucket, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to &lt;strong&gt;Settings &amp;gt; Workspace setting &amp;gt; OAuth consumers&lt;/strong&gt; in BitBucket.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create an application by selecting &lt;strong&gt;Add consumer&lt;/strong&gt; and using the following parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Allowed Callback URLs: &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;/login/generic_oauth&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file using the values from the &lt;code&gt;Key&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; from the consumer description:&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;[auth.generic_oauth]
name = BitBucket
enabled = true
allow_sign_up = true
auto_login = false
client_id = &amp;lt;client key&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = account email
auth_url = https://bitbucket.org/site/oauth2/authorize
token_url = https://bitbucket.org/site/oauth2/access_token
api_url = https://api.bitbucket.org/2.0/user
teams_url = https://api.bitbucket.org/2.0/user/permissions/workspaces
team_ids_attribute_path = values[*].workspace.slug
team_ids =
allowed_organizations =
use_refresh_token = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By default, a refresh token is included in the response for the &lt;strong&gt;Authorization Code Grant&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&#34;set-up-oauth2-with-onelogin&#34;&gt;Set up OAuth2 with OneLogin&lt;/h3&gt;
&lt;p&gt;To set up Generic OAuth authentication with OneLogin, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Custom Connector in OneLogin with the following settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: Grafana&lt;/li&gt;
&lt;li&gt;Sign On Method: OpenID Connect&lt;/li&gt;
&lt;li&gt;Redirect URI: &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;/login/generic_oauth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Signing Algorithm: RS256&lt;/li&gt;
&lt;li&gt;Login URL: &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;/login/generic_oauth&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add an app to the Grafana Connector:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Display Name: Grafana&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the Grafana configuration file using the client ID and client secret from the &lt;strong&gt;SSO&lt;/strong&gt; tab of the app details page:&lt;/p&gt;
&lt;p&gt;Your OneLogin Domain will match the URL you use to access OneLogin.&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;[auth.generic_oauth]
name = OneLogin
enabled = true
allow_sign_up = true
auto_login = false
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid email name
auth_url = https://&amp;lt;onelogin domain&amp;gt;.onelogin.com/oidc/2/auth
token_url = https://&amp;lt;onelogin domain&amp;gt;.onelogin.com/oidc/2/token
api_url = https://&amp;lt;onelogin domain&amp;gt;.onelogin.com/oidc/2/me
team_ids =
allowed_organizations =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-up-oauth2-with-dex&#34;&gt;Set up OAuth2 with Dex&lt;/h3&gt;
&lt;p&gt;To set up Generic OAuth authentication with &lt;a href=&#34;https://dexidp.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Dex IdP&lt;/a&gt;, follow these
steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add Grafana as a client in the Dex config YAML 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;YAML&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-yaml&#34;&gt;staticClients:
  - id: &amp;lt;client id&amp;gt;
    name: Grafana
    secret: &amp;lt;client secret&amp;gt;
    redirectURIs:
      - &amp;#39;https://&amp;lt;grafana domain&amp;gt;/login/generic_oauth&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Unlike many other OAuth2 providers, Dex doesn&amp;rsquo;t provide &lt;code&gt;&amp;lt;client secret&amp;gt;&lt;/code&gt;.
Instead, a secret can be generated with for example &lt;code&gt;openssl rand -hex 20&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section of the 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;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;[auth.generic_oauth]
name = Dex
enabled = true
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid email profile groups offline_access
auth_url = https://&amp;lt;dex base uri&amp;gt;/auth
token_url = https://&amp;lt;dex base uri&amp;gt;/token
api_url = https://&amp;lt;dex base uri&amp;gt;/userinfo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;dex base uri&amp;gt;&lt;/code&gt; corresponds to the &lt;code&gt;issuer: &lt;/code&gt; configuration in Dex (e.g. the Dex
domain possibly including a path such as e.g. &lt;code&gt;/dex&lt;/code&gt;). The &lt;code&gt;offline_access&lt;/code&gt; scope is
needed when using &lt;a href=&#34;#configure-a-refresh-token&#34;&gt;refresh tokens&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="configure-generic-oauth-authentication">Configure Generic OAuth authentication&lt;/h1>
&lt;div data-shared="auth/intro.md">
&lt;p>There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p></description></item><item><title>Configure Microsoft Entra ID OAuth authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/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/entraid/</guid><content><![CDATA[&lt;h1 id=&#34;configure-microsoft-entra-id-oauth-authentication&#34;&gt;Configure Microsoft Entra ID OAuth authentication&lt;/h1&gt;
&lt;p&gt;The Microsoft Entra ID authentication allows you to use a Microsoft Entra ID (formerly known as Azure Active Directory) tenant as an identity provider for Grafana. You can use Entra ID application roles to assign users and groups to Grafana roles from the Azure Portal.&lt;/p&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;If you use the same email address in Microsoft Entra ID and in other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that your users are matched correctly.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; for more information.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;register-your-application-with-microsoft-entra-id&#34;&gt;Register your application with Microsoft Entra ID&lt;/h2&gt;
&lt;p&gt;To enable the Entra ID OAuth, register your application with Entra ID.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to the &lt;a href=&#34;https://portal.azure.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure portal&lt;/a&gt;, then click &lt;strong&gt;Microsoft Entra ID&lt;/strong&gt; in the side menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you have access to more than one tenant, select your account in the upper right. Set your session to the Entra ID tenant you wish to use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under &lt;strong&gt;Manage&lt;/strong&gt; in the side menu, click &lt;strong&gt;App Registrations&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Registration&lt;/strong&gt;. Enter a descriptive name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under &lt;strong&gt;Redirect URI&lt;/strong&gt;, select the app type &lt;strong&gt;Web&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the redirect URLs &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;/login/azuread&lt;/code&gt; and &lt;code&gt;https://&amp;lt;grafana domain&amp;gt;&lt;/code&gt;, then click &lt;strong&gt;Register&lt;/strong&gt;. The app&amp;rsquo;s &lt;strong&gt;Overview&lt;/strong&gt; page opens.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Note the &lt;strong&gt;Application ID&lt;/strong&gt;. This is the OAuth client ID.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Endpoints&lt;/strong&gt; from the top menu.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Note the &lt;strong&gt;OAuth 2.0 authorization endpoint (v2)&lt;/strong&gt; URL. This is the authorization URL.&lt;/li&gt;
&lt;li&gt;Note the &lt;strong&gt;OAuth 2.0 token endpoint (v2)&lt;/strong&gt;. This is the token URL.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Certificates &amp;amp; secrets&lt;/strong&gt; in the side menu, then add a new entry under the supported client authentication option you want to use. The following are the supported client authentication options with their respective configuration steps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Client secrets&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add a new entry under &lt;strong&gt;Client secrets&lt;/strong&gt; with the following configuration.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Description: Grafana OAuth 2.0&lt;/li&gt;
&lt;li&gt;Expires: Select an expiration period&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add&lt;/strong&gt; then copy the key &lt;strong&gt;Value&lt;/strong&gt;. This is the OAuth 2.0 client secret.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;Make sure that you copy the string in the &lt;strong&gt;Value&lt;/strong&gt; field, rather than the one in the &lt;strong&gt;Secret ID&lt;/strong&gt; field.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;You must have set &lt;code&gt;client_authentication&lt;/code&gt; under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;client_secret_post&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Federated credentials&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Managed Identity&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Refer to &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-config-app-trust-managed-identity?tabs=microsoft-entra-admin-center&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Configure an application to trust a managed identity (preview)&lt;/a&gt; for a complete guide on setting up a managed identity as a federated credential.
Add a new entry under Federated credentials with the following configuration.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Federated credential scenario: Select &lt;strong&gt;Other issuer&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Issuer: The OAuth 2.0 / OIDC issuer URL of the Microsoft Entra ID authority. For example: &lt;code&gt;https://login.microsoftonline.com/{tenantID}/v2.0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Subject identifier: The Object (Principal) ID GUID of the Managed Identity.&lt;/li&gt;
&lt;li&gt;Name: A unique descriptive name for the credential.&lt;/li&gt;
&lt;li&gt;Description: Grafana OAuth.&lt;/li&gt;
&lt;li&gt;Audience: The audience value that must appear in the external token. For Public cloud, it would be &lt;code&gt;api://AzureADTokenExchange&lt;/code&gt;. See mentioned documentation for the full list of available audiences.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add&lt;/strong&gt;, and then copy the Managed Identity Client ID and the federated credential Audience values. This is your OAuth 2.0 federated credential.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;client_authentication&lt;/code&gt; under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;managed_identity&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;Managed identities as federated credentials are only applicable to workloads hosted in Azure.&lt;/p&gt;
&lt;p&gt;You can only add user-assigned managed identities as federated credentials on Entra ID applications.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Workload Identity (K8s/AKS)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Refer to &lt;a href=&#34;https://azure.github.io/azure-workload-identity/docs/topics/federated-identity-credential.html#azure-portal-ui&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Federated identity credential for an Entra ID application&lt;/a&gt; for a complete guide on setting up a federated credential for workload identity.
Add a new entry under Federated credentials with the following configuration.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Federated credential scenario: Select &lt;strong&gt;Kubernetes accessing Azure resources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer#get-the-oidc-issuer-url&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Cluster issuer URL&lt;/a&gt;: The OIDC issuer URL that your cluster is integrated with. For example: &lt;code&gt;https://{region}.oic.prod-aks.azure.com/{tenant_id}/{uuid}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Namespace: Namespace of your Grafana deployment. For example: &lt;code&gt;grafana&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Service account name: Service account name of your Grafana deployment. For example: &lt;code&gt;grafana&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Subject identifier: The expected identity (subject claim) from the OIDC token, which Azure uses to validate and authorize token issuance to the requesting workload. For example: &lt;code&gt;system:serviceaccount:grafana:grafana&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Name: A unique descriptive name for the credential.&lt;/li&gt;
&lt;li&gt;Description: Grafana OAuth.&lt;/li&gt;
&lt;li&gt;Audience: The audience value that must appear in the external token. For Public cloud, it would be &lt;code&gt;api://AzureADTokenExchange&lt;/code&gt;. See mentioned documentation for the full list of available audiences.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;client_authentication&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_CLIENT_AUTHENTICATION&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;workload_identity&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You may optionally set &lt;code&gt;workload_identity_token_file&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_WORKLOAD_IDENTITY_TOKEN_FILE&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;/var/run/secrets/azure/tokens/azure-identity-token&lt;/code&gt; in the Grafana server configuration for this to work. (Optional, defaults to &lt;code&gt;/var/run/secrets/azure/tokens/azure-identity-token&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;client_id&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_CLIENT_ID&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; in the Grafana server configuration for this to work. This must match the Entra ID/Entra ID App Registration Application (client) ID.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;token_url&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_TOKEN_URL&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;https://login.microsoftonline.com/{tenantID}/oauth2/v2.0/token&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;auth_url&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_AUTH_URL&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;https://login.microsoftonline.com/{tenantID}/oauth2/v2.0/authorize&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must have set &lt;code&gt;federated_credential_audience&lt;/code&gt; (env var &lt;code&gt;GF_AUTH_AZUREAD_FEDERATED_CREDENTIAL_AUDIENCE&lt;/code&gt;) under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;api://AzureADTokenExchange&lt;/code&gt; in the Grafana server configuration for this to work.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&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;Managed identities as federated credentials are only applicable to workloads hosted in Azure.&lt;/p&gt;
&lt;p&gt;You can only add user-assigned managed identities as federated credentials on Entra ID applications.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Define the required application roles for Grafana &lt;a href=&#34;#configure-application-roles-for-grafana-in-the-azure-portal&#34;&gt;using the Azure Portal&lt;/a&gt; or &lt;a href=&#34;#configure-application-roles-for-grafana-in-the-manifest-file&#34;&gt;using the manifest file&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Microsoft Entra ID&lt;/strong&gt; and then to &lt;strong&gt;Enterprise Applications&lt;/strong&gt;, under &lt;strong&gt;Manage&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Search for your application and click it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Users and Groups&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add user/group&lt;/strong&gt; to add a user or group to the Grafana roles.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;When assigning a group to a Grafana role, ensure that users are direct members of the group. Users in nested groups will not have access to Grafana due to limitations within Entra ID side. For more information, see &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity/users/directory-service-limits-restrictions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Microsoft Entra service limits and restrictions&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-application-roles-for-grafana-in-the-microsoft-entra-id-portal&#34;&gt;Configure application roles for Grafana in the Microsoft Entra ID portal&lt;/h3&gt;
&lt;p&gt;This section describes setting up basic application roles for Grafana within the Entra ID Portal. For more information, see &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/howto-add-app-roles-in-apps&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Add app roles to your application and receive them in the token&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;App Registrations&lt;/strong&gt;, search for your application, and click it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;App roles&lt;/strong&gt; and then &lt;strong&gt;Create app role&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Define a role corresponding to each Grafana role: Viewer, Editor, and Admin.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Choose a &lt;strong&gt;Display name&lt;/strong&gt; for the role. For example, &amp;ldquo;Grafana Editor&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the &lt;strong&gt;Allowed member types&lt;/strong&gt; to &lt;strong&gt;Users/Groups&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure that the &lt;strong&gt;Value&lt;/strong&gt; field matches the Grafana role name. For example, &amp;ldquo;Editor&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose a &lt;strong&gt;Description&lt;/strong&gt; for the role. For example, &amp;ldquo;Grafana Editor Users&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-application-roles-for-grafana-in-the-manifest-file&#34;&gt;Configure application roles for Grafana in the manifest file&lt;/h3&gt;
&lt;p&gt;If you prefer to configure the application roles for Grafana in the manifest file, complete the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;App Registrations&lt;/strong&gt;, search for your application, and click it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Manifest&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add a Universally Unique Identifier to each role.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;Every role requires a &lt;a href=&#34;https://en.wikipedia.org/wiki/Universally_unique_identifier&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Universally Unique Identifier&lt;/a&gt; which you can generate on Linux with &lt;code&gt;uuidgen&lt;/code&gt;, and on Windows through Microsoft PowerShell with &lt;code&gt;New-Guid&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Replace each &amp;ldquo;SOME_UNIQUE_ID&amp;rdquo; with the generated ID in the manifest 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;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;appRoles&amp;#34;: [
			{
				&amp;#34;allowedMemberTypes&amp;#34;: [
					&amp;#34;User&amp;#34;
				],
				&amp;#34;description&amp;#34;: &amp;#34;Grafana org admin Users&amp;#34;,
				&amp;#34;displayName&amp;#34;: &amp;#34;Grafana Org Admin&amp;#34;,
				&amp;#34;id&amp;#34;: &amp;#34;SOME_UNIQUE_ID&amp;#34;,
				&amp;#34;isEnabled&amp;#34;: true,
				&amp;#34;lang&amp;#34;: null,
				&amp;#34;origin&amp;#34;: &amp;#34;Application&amp;#34;,
				&amp;#34;value&amp;#34;: &amp;#34;Admin&amp;#34;
			},
			{
				&amp;#34;allowedMemberTypes&amp;#34;: [
					&amp;#34;User&amp;#34;
				],
				&amp;#34;description&amp;#34;: &amp;#34;Grafana read only Users&amp;#34;,
				&amp;#34;displayName&amp;#34;: &amp;#34;Grafana Viewer&amp;#34;,
				&amp;#34;id&amp;#34;: &amp;#34;SOME_UNIQUE_ID&amp;#34;,
				&amp;#34;isEnabled&amp;#34;: true,
				&amp;#34;lang&amp;#34;: null,
				&amp;#34;origin&amp;#34;: &amp;#34;Application&amp;#34;,
				&amp;#34;value&amp;#34;: &amp;#34;Viewer&amp;#34;
			},
			{
				&amp;#34;allowedMemberTypes&amp;#34;: [
					&amp;#34;User&amp;#34;
				],
				&amp;#34;description&amp;#34;: &amp;#34;Grafana Editor Users&amp;#34;,
				&amp;#34;displayName&amp;#34;: &amp;#34;Grafana Editor&amp;#34;,
				&amp;#34;id&amp;#34;: &amp;#34;SOME_UNIQUE_ID&amp;#34;,
				&amp;#34;isEnabled&amp;#34;: true,
				&amp;#34;lang&amp;#34;: null,
				&amp;#34;origin&amp;#34;: &amp;#34;Application&amp;#34;,
				&amp;#34;value&amp;#34;: &amp;#34;Editor&amp;#34;
			}
		],&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;assign-server-administrator-privileges&#34;&gt;Assign server administrator privileges&lt;/h3&gt;
&lt;p&gt;Use the application role &lt;code&gt;GrafanaAdmin&lt;/code&gt; to grant users server administrator privileges. This is useful if you want to grant server administrator privileges to a subset of users.&lt;/p&gt;
&lt;p&gt;Grafana also assigns the user the &lt;code&gt;Admin&lt;/code&gt; role of the default organization.&lt;/p&gt;
&lt;p&gt;Set the setting &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; under &lt;code&gt;[auth.azuread]&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; for this to work.
If the setting is set to &lt;code&gt;false&lt;/code&gt;, the user is assigned the role of &lt;code&gt;Admin&lt;/code&gt; of the default organization, but not server administrator privileges.&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;allowedMemberTypes&amp;#34;: [&amp;#34;User&amp;#34;],
  &amp;#34;description&amp;#34;: &amp;#34;Grafana server admin Users&amp;#34;,
  &amp;#34;displayName&amp;#34;: &amp;#34;Grafana Server Admin&amp;#34;,
  &amp;#34;id&amp;#34;: &amp;#34;SOME_UNIQUE_ID&amp;#34;,
  &amp;#34;isEnabled&amp;#34;: true,
  &amp;#34;lang&amp;#34;: null,
  &amp;#34;origin&amp;#34;: &amp;#34;Application&amp;#34;,
  &amp;#34;value&amp;#34;: &amp;#34;GrafanaAdmin&amp;#34;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-the-entra-id-authentication-client-using-the-grafana-ui&#34;&gt;Configure the Entra ID authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;After you&amp;rsquo;ve registered your application with Entra Id, As a Grafana Admin, you can configure your Entra ID OAuth client from within Grafana using the Grafana UI. To do this, navigate to the &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; Entra ID&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file, the form will be pre-populated with those values. Otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt; to save the configuration. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes you made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;configure-the-entra-id-authentication-client-using-the-terraform-provider&#34;&gt;Configure the Entra ID authentication client using the Terraform provider&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;azuread_sso_settings&amp;#34; {
  provider_name = &amp;#34;azuread&amp;#34;
  oauth2_settings {
    name                          = &amp;#34;Entra ID&amp;#34;
    auth_url                      = &amp;#34;https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize&amp;#34;
    token_url                     = &amp;#34;https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token&amp;#34;
    client_authentication         = &amp;#34;CLIENT_AUTHENTICATION_OPTION&amp;#34;
    client_id                     = &amp;#34;APPLICATION_ID&amp;#34;
    client_secret                 = &amp;#34;CLIENT_SECRET&amp;#34;
    managed_identity_client_id    = &amp;#34;MANAGED_IDENTITY_CLIENT_ID&amp;#34;
    federated_credential_audience = &amp;#34;FEDERATED_CREDENTIAL_AUDIENCE&amp;#34;
    allow_sign_up                 = true
    auto_login                    = false
    scopes                        = &amp;#34;openid email profile&amp;#34;
    allowed_organizations         = &amp;#34;TENANT_ID&amp;#34;
    role_attribute_strict         = false
    allow_assign_grafana_admin    = false
    skip_org_role_sync            = false
    use_pkce                      = true
    custom = {
      domain_hint = &amp;#34;contoso.com&amp;#34;
      force_use_graph_api = &amp;#34;true&amp;#34;
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/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;
&lt;h2 id=&#34;configure-the-entra-id-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure the Entra ID authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;enable-entra-id-oauth-in-grafana&#34;&gt;Enable Entra ID OAuth in Grafana&lt;/h3&gt;
&lt;p&gt;Add the following to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&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;[auth.azuread]
name = Entra ID
enabled = true
allow_sign_up = true
auto_login = false
client_authentication = CLIENT_AUTHENTICATION_OPTION
client_id = APPLICATION_ID
client_secret = CLIENT_SECRET
managed_identity_client_id = MANAGED_IDENTITY_CLIENT_ID
federated_credential_audience = FEDERATED_CREDENTIAL_AUDIENCE
scopes = openid email profile
auth_url = https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/token
allowed_domains =
allowed_groups =
allowed_organizations = TENANT_ID
role_attribute_strict = false
allow_assign_grafana_admin = false
skip_org_role_sync = false
use_pkce = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can also use these environment variables to configure &lt;code&gt;client_authentication&lt;/code&gt;, &lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;client_secret&lt;/code&gt;, &lt;code&gt;managed_identity_client_id&lt;/code&gt;, and &lt;code&gt;federated_credential_audience&lt;/code&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;GF_AUTH_AZUREAD_CLIENT_AUTHENTICATION
GF_AUTH_AZUREAD_CLIENT_ID
GF_AUTH_AZUREAD_CLIENT_SECRET
GF_AUTH_AZUREAD_MANAGED_IDENTITY_CLIENT_ID
GF_AUTH_AZUREAD_FEDERATED_CREDENTIAL_AUDIENCE&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Verify that the Grafana &lt;a href=&#34;../../../configure-grafana/#root_url&#34;&gt;root_url&lt;/a&gt; is set in your Azure Application Redirect URLs.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-refresh-token&#34;&gt;Configure refresh token&lt;/h3&gt;
&lt;p&gt;When a user logs in using an OAuth provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token.&lt;/p&gt;
&lt;p&gt;Grafana uses a refresh token to obtain a new access token without requiring the user to log in again. If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;Refresh token fetching and access token expiration check is enabled by default for the Entra ID provider since Grafana v10.1.0. If you would like to disable access token expiration check then set the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value to &lt;code&gt;false&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;The &lt;code&gt;accessTokenExpirationCheck&lt;/code&gt; feature toggle has been removed in Grafana v10.3.0 and the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value will be used instead for configuring refresh token fetching and access token expiration check.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-allowed-tenants&#34;&gt;Configure allowed tenants&lt;/h3&gt;
&lt;p&gt;To limit access to authenticated users who are members of one or more tenants, set &lt;code&gt;allowed_organizations&lt;/code&gt;
to a &lt;em&gt;comma-&lt;/em&gt; or &lt;em&gt;space-separated&lt;/em&gt; list of tenant IDs. You can find tenant IDs on the Azure portal under &lt;strong&gt;Microsoft Entra ID -&amp;gt; Overview&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Make sure to include the tenant IDs of all the federated Users&amp;rsquo; root directory if your Entra ID contains external identities.&lt;/p&gt;
&lt;p&gt;For example, if you want to only give access to members of the tenant &lt;code&gt;example&lt;/code&gt; with an ID of &lt;code&gt;8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt;, then set the following:&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;allowed_organizations = 8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-allowed-groups&#34;&gt;Configure allowed groups&lt;/h3&gt;
&lt;p&gt;Microsoft Entra ID groups can be used to limit user access to Grafana. For more information about managing groups in Entra ID, refer to &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/fundamentals/how-to-manage-groups&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Manage Microsoft Entra groups and group membership&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To limit access to authenticated users who are members of one or more Entra ID groups, set &lt;code&gt;allowed_groups&lt;/code&gt;
to a &lt;em&gt;comma-&lt;/em&gt; or &lt;em&gt;space-separated&lt;/em&gt; list of group object IDs.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To find object IDs for a specific group on the Azure portal, go to &lt;strong&gt;Microsoft Entra ID &amp;gt; Manage &amp;gt; Groups&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can find the Object Id of a group by clicking on the group and then clicking on &lt;strong&gt;Properties&lt;/strong&gt;. The object ID is listed under &lt;strong&gt;Object ID&lt;/strong&gt;. If you want to only give access to members of the group &lt;code&gt;example&lt;/code&gt; with an Object Id of &lt;code&gt;8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt;, then set the following:&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;  allowed_groups = 8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You must enable adding the &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims#configure-groups-optional-claims&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;group attribute&lt;/a&gt; to the tokens in your Entra ID App registration either &lt;a href=&#34;#configure-group-membership-claims-on-the-azure-portal&#34;&gt;from the Azure Portal&lt;/a&gt; or &lt;a href=&#34;#configure-group-membership-claim-in-the-manifest-file&#34;&gt;from the manifest file&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;configure-group-membership-claims-on-the-azure-portal&#34;&gt;Configure group membership claims on the Azure Portal&lt;/h4&gt;
&lt;p&gt;To ensure that the &lt;code&gt;groups&lt;/code&gt; claim is included in the token, add the &lt;code&gt;groups&lt;/code&gt; claim to the token configuration either through the Azure Portal UI or by editing the manifest file.&lt;/p&gt;
&lt;p&gt;To configure group membership claims from the Azure Portal UI, complete the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;App Registrations&lt;/strong&gt; page and select your application.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Manage&lt;/strong&gt; in the side menu, select &lt;strong&gt;Token configuration&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add groups claim&lt;/strong&gt; and select the relevant option for your use case (for example, &lt;strong&gt;Security groups&lt;/strong&gt; and &lt;strong&gt;Groups assigned to the application&lt;/strong&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more information, see &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims#configure-groups-optional-claims&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Configure groups optional claims&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;If the user is a member of more than 200 groups, Entra ID does not emit the groups claim in the token and instead emits a group overage claim. To set up a group overage claim, see &lt;a href=&#34;#users-with-over-200-group-assignments&#34;&gt;Users with over 200 Group assignments&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-group-membership-claim-in-the-manifest-file&#34;&gt;Configure group membership claim in the manifest file&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;App Registrations&lt;/strong&gt;, search for your application, and click it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Manifest&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the following to the root of the manifest file:&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;&amp;#34;groupMembershipClaims&amp;#34;: &amp;#34;ApplicationGroup, SecurityGroup&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-allowed-domains&#34;&gt;Configure allowed domains&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;allowed_domains&lt;/code&gt; option limits access to users who belong to specific domains. Separate domains with space or comma. For example,&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;allowed_domains = mycompany.com mycompany.org&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;pkce&#34;&gt;PKCE&lt;/h3&gt;
&lt;p&gt;IETF&amp;rsquo;s &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RFC 7636&lt;/a&gt;
introduces &amp;ldquo;proof key for code exchange&amp;rdquo; (PKCE) which provides
additional protection against some forms of authorization code
interception attacks. PKCE will be required in &lt;a href=&#34;https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-03&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OAuth 2.1&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can disable PKCE in Grafana by setting &lt;code&gt;use_pkce&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in the&lt;code&gt;[auth.azuread]&lt;/code&gt; section.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;configure-automatic-login&#34;&gt;Configure automatic login&lt;/h3&gt;
&lt;p&gt;To bypass the login screen and log in automatically, enable the &amp;ldquo;auto_login&amp;rdquo; feature.
This setting is ignored if multiple auth providers are configured to use auto login.&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;h3 id=&#34;team-sync&#34;&gt;Team Sync&lt;/h3&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;With Team Sync you can map your Entra ID groups to teams in Grafana so that your users will automatically be added to
the correct teams.&lt;/p&gt;
&lt;p&gt;You can reference Entra ID groups by group object ID, like &lt;code&gt;8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To learn more, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Team Sync&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;skip-organization-role-sync&#34;&gt;Skip organization role sync&lt;/h2&gt;
&lt;p&gt;If you don&amp;rsquo;t want Entra ID authentication to sync user roles and organization membership and prevent the sync of org roles from Entra ID, set &lt;code&gt;skip_org_role_sync&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;. Use this if you want to manage the organization roles for your users from within Grafana or that your organization roles are synced from another provider.
See &lt;a href=&#34;../../../configure-grafana/#authazuread&#34;&gt;Configure Grafana&lt;/a&gt; for more details.&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.azuread]
# ..
# prevents the sync of org roles from Entra ID
skip_org_role_sync = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table outlines the various Entra ID configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with 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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Enables Entra ID authentication.&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;Yes&lt;/td&gt;
              &lt;td&gt;Name that refers to the Entra ID authentication from the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;OAuth&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for the Entra ID authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;signin&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_authentication&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Defines the client authentication method used to authenticate to the token endpoint. Supported values: &lt;code&gt;none&lt;/code&gt;, &lt;code&gt;client_secret_post&lt;/code&gt;, &lt;code&gt;managed_identity&lt;/code&gt;, or &lt;code&gt;workload_identity&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;workload_identity_token_file&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The path to the token file used to authenticate to the OAuth2 provider. This is only required when &lt;code&gt;client_authentication&lt;/code&gt; is set to &lt;code&gt;workload_identity&lt;/code&gt;. The token file contains the service account token projected by Kubernetes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/var/run/secrets/azure/tokens/azure-identity-token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;federated_credential_audience&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The audience of the federated identity credential of your OAuth2 app. Required when &lt;code&gt;client_authentication&lt;/code&gt; is set to &lt;code&gt;managed_identity&lt;/code&gt; or &lt;code&gt;workload_identity&lt;/code&gt;. For public cloud, this is typically &lt;code&gt;api://AzureADTokenExchange&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;api://AzureADTokenExchange&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID of the App (&lt;code&gt;Application (client) ID&lt;/code&gt; on the &lt;strong&gt;App registration&lt;/strong&gt; dashboard).&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret of the App.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of the Entra ID OAuth2 provider.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_style&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Name of the &lt;a href=&#34;https://pkg.go.dev/golang.org/x/oauth2#AuthStyle&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OAuth2 AuthStyle&lt;/a&gt; to be used when ID token is requested from OAuth2 provider. It determines how &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;client_secret&lt;/code&gt; are sent to Oauth2 provider. Available values are &lt;code&gt;AutoDetect&lt;/code&gt;, &lt;code&gt;InParams&lt;/code&gt; and &lt;code&gt;InHeader&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;AutoDetect&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated OAuth2 scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;openid email profile&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;Yes&lt;/td&gt;
              &lt;td&gt;Controls Grafana user creation through the Entra ID login. Only existing Grafana users can log in with Entra ID if set to &lt;code&gt;false&lt;/code&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;login_prompt&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Indicates the type of user interaction when the user logs in with Entra ID. Available values are &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;consent&lt;/code&gt; and &lt;code&gt;select_account&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_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana org role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt; or &lt;code&gt;org_mapping&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#map-roles&#34;&gt;Map roles&lt;/a&gt;.&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;org_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana org to role lookup. Grafana will first evaluate the expression using the OAuth2 ID token. If no value is returned, the expression will be evaluated using the user information obtained from the UserInfo endpoint. The result of the evaluation will be mapped to org roles based on &lt;code&gt;org_mapping&lt;/code&gt;. For more information on org to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalOrgName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allow_assign_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to automatically sync the Grafana server administrator role. When enabled, if the Entra ID user&amp;rsquo;s App role is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user server administrator privileges and the organization administrator role. If disabled, the user will only receive the organization administrator role. For more details on user role mapping, refer to &lt;a href=&#34;#map-roles&#34;&gt;Map roles&lt;/a&gt;.&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;skip_org_role_sync&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles. This will allow you to set organization roles for your users from within Grafana manually.&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;allowed_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated groups. The user should be a member of at least one group to log in. If you configure &lt;code&gt;allowed_groups&lt;/code&gt;, you must also configure Entra ID to include the &lt;code&gt;groups&lt;/code&gt; claim following &lt;a href=&#34;#configure-group-membership-claims-on-the-azure-portal&#34;&gt;Configure group membership claims on the Azure Portal&lt;/a&gt;.&lt;/td&gt;
              &lt;td&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;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated Azure tenant identifiers. The user should be a member of at least one tenant to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated domains. The user should belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;domain_hint&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;The realm of the user in a federated directory. This skips the email-based discovery process that the user goes through on the Entra ID sign-in page, for a slightly more streamlined user experience. More info &lt;a href=&#34;https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#send-the-sign-in-request&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt;, the client accepts any certificate presented by the server and any host name in that certificate. &lt;em&gt;You should only use this for testing&lt;/em&gt;, because this mode leaves SSL/TLS susceptible to man-in-the-middle attacks.&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;tls_client_cert&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_key&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_ca&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the trusted certificate authority list.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;use_pkce&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Proof Key for Code Exchange (PKCE)&lt;/a&gt;. Grafana uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&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;use_refresh_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Enables the use of refresh tokens and checks for access token expiration. When enabled, Grafana automatically adds the &lt;code&gt;offline_access&lt;/code&gt; scope to the list of scopes.&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;force_use_graph_api&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to always fetch groups from the Microsoft Graph API instead of the &lt;code&gt;id_token&lt;/code&gt;. If a user belongs to more than 200 groups, the Microsoft Graph API will be used to retrieve the groups regardless of this setting.&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;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;common-troubleshooting&#34;&gt;Common troubleshooting&lt;/h2&gt;
&lt;p&gt;Here are some common issues and particulars you can run into when configuring Entra ID authentication in Grafana.&lt;/p&gt;
&lt;h3 id=&#34;users-with-over-200-group-assignments&#34;&gt;Users with over 200 Group assignments&lt;/h3&gt;
&lt;p&gt;To ensure that the token size doesn&amp;rsquo;t exceed HTTP header size limits,
Entra ID limits the number of object IDs that it includes in the groups claim.
If a user is member of more groups than the coverage limit (200), then Entra ID does not emit the groups claim in the token and emits a group overage claim instead.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;More information in &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;Groups overage claim&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If Grafana receives a token with a group overage claim instead of a groups claim,
Grafana attempts to retrieve the user&amp;rsquo;s group membership by calling the included endpoint.&lt;/p&gt;
&lt;p&gt;The Entra ID &lt;code&gt;App registration&lt;/code&gt; must include the following API permissions for group overage claim calls to succeed:&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;Delegated&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;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Admin consent is required for the &lt;code&gt;GroupMember.Read.All&lt;/code&gt; permission. To grant admin consent, navigate to &lt;strong&gt;API permissions&lt;/strong&gt; in the &lt;strong&gt;App registration&lt;/strong&gt; and select &lt;strong&gt;Grant admin consent for [your-organization]&lt;/strong&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;You can make Grafana always get group information from the Microsoft Graph API by turning on the &lt;a href=&#34;./#force-fetching-groups-from-microsoft-graph-api&#34;&gt;&lt;code&gt;force_use_graph_api&lt;/code&gt;&lt;/a&gt; setting in the configuration.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-the-required-graph-api-permissions&#34;&gt;Configure the required Graph API permissions&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Microsoft Entra ID &amp;gt; Manage &amp;gt; App registrations&lt;/strong&gt; and select your application.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;API permissions&lt;/strong&gt; and then click on &lt;strong&gt;Add a permission&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Microsoft Graph&lt;/strong&gt; from the list of APIs.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Delegated permissions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;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;Click &lt;strong&gt;Add permissions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Microsoft Graph&lt;/strong&gt; from the list of APIs.&lt;/li&gt;
&lt;li&gt;Select &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;/ol&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;Admin consent may be required for this permission.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;force-fetching-groups-from-microsoft-graph-api&#34;&gt;Force fetching groups from Microsoft Graph API&lt;/h3&gt;
&lt;p&gt;To force fetching groups from Microsoft Graph API instead of the &lt;code&gt;id_token&lt;/code&gt;, you can use the &lt;code&gt;force_use_graph_api&lt;/code&gt; configuration 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;[auth.azuread]
force_use_graph_api = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;map-roles&#34;&gt;Map roles&lt;/h3&gt;
&lt;p&gt;By default, Entra ID authentication will map users to organization roles based on the most privileged application role assigned to the user in Entra ID.&lt;/p&gt;
&lt;p&gt;If no application role is found, the user is assigned the role specified by
&lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned and the &lt;code&gt;org_mapping&lt;/code&gt; expression evaluates to an empty mapping.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_mapping&lt;/code&gt; configuration option to assign the user to multiple organizations and specify their role based on their Entra ID group membership. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If the org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) is specified and Entra ID returns a valid role, then the user will get the highest of the two roles.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;On every login&lt;/em&gt; the user organization role will be reset to match Entra ID&amp;rsquo;s application role and
their organization membership will be reset to the default organization.&lt;/p&gt;
&lt;h4 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h4&gt;
&lt;p&gt;The Entra ID integration uses the external users&amp;rsquo; groups in the &lt;code&gt;org_mapping&lt;/code&gt; configuration to map organizations and roles based on their Entra ID group membership.&lt;/p&gt;
&lt;p&gt;In this example, the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; organization, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; orgs.&lt;/p&gt;
&lt;p&gt;The external user is part of the following Entra ID groups: &lt;code&gt;032cb8e0-240f-4347-9120-6f33013e817a&lt;/code&gt; and &lt;code&gt;bce1c492-0679-4989-941b-8de5e6789cb9&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Config:&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;032cb8e0-240f-4347-9120-6f33013e817a:org_foo:Viewer&amp;#34;, &amp;#34;bce1c492-0679-4989-941b-8de5e6789cb9:org_bar:Editor&amp;#34;, &amp;#34;*:org_baz:Editor&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-microsoft-entra-id-oauth-authentication">Configure Microsoft Entra ID OAuth authentication&lt;/h1>
&lt;p>The Microsoft Entra ID authentication allows you to use a Microsoft Entra ID (formerly known as Azure Active Directory) tenant as an identity provider for Grafana. You can use Entra ID application roles to assign users and groups to Grafana roles from the Azure Portal.&lt;/p></description></item><item><title>Configure GitHub OAuth authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/github/</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/github/</guid><content><![CDATA[&lt;h1 id=&#34;configure-github-oauth-authentication&#34;&gt;Configure GitHub OAuth authentication&lt;/h1&gt;


&lt;div data-shared=&#34;auth/intro.md&#34;&gt;
            &lt;p&gt;There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p&gt;
&lt;p&gt;When deciding on an authentication method, it&amp;rsquo;s important to take into account your current identity and access management system as well as the specific authentication and authorization features you require.
For a complete list of the available authentication options and the features they support, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/&#34;&gt;Configure authentication&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;

        
&lt;p&gt;This topic describes how to configure GitHub OAuth authentication.&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;If Users use the same email address in GitHub that they use with other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&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 know how to create a GitHub OAuth app. Consult GitHub&amp;rsquo;s documentation on &lt;a href=&#34;https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;creating an OAuth app&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h3 id=&#34;create-a-github-oauth-app&#34;&gt;Create a GitHub OAuth App&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Log in to your GitHub account.
In &lt;strong&gt;Profile &amp;gt; Settings &amp;gt; Developer settings&lt;/strong&gt;, select &lt;strong&gt;OAuth Apps&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New OAuth App&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill out the fields, using your Grafana homepage URL when appropriate.
In the &lt;strong&gt;Authorization callback URL&lt;/strong&gt; field, enter the following: &lt;code&gt;https://&amp;lt;YOUR-GRAFANA-URL&amp;gt;/login/github&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Note your client ID.&lt;/li&gt;
&lt;li&gt;Generate, then note, your client secret.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-github-authentication-client-using-the-grafana-ui&#34;&gt;Configure GitHub authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;As a Grafana Admin, you can configure GitHub OAuth client from within Grafana using the GitHub UI. To do this, navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; GitHub&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file, the form will be pre-populated with those values. Otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt;. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes you made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h2 id=&#34;configure-github-authentication-client-using-the-terraform-provider&#34;&gt;Configure GitHub authentication client using the Terraform provider&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;github_sso_settings&amp;#34; {
  provider_name = &amp;#34;github&amp;#34;
  oauth2_settings {
    name                  = &amp;#34;Github&amp;#34;
    client_id             = &amp;#34;YOUR_GITHUB_APP_CLIENT_ID&amp;#34;
    client_secret         = &amp;#34;YOUR_GITHUB_APP_CLIENT_SECRET&amp;#34;
    allow_sign_up         = true
    auto_login            = false
    scopes                = &amp;#34;user:email,read:org&amp;#34;
    team_ids              = &amp;#34;150,300&amp;#34;
    allowed_organizations = &amp;#34;[\&amp;#34;My Organization\&amp;#34;, \&amp;#34;Octocats\&amp;#34;]&amp;#34;
    allowed_domains       = &amp;#34;mycompany.com mycompany.org&amp;#34;
    role_attribute_path   = &amp;#34;[login==&amp;#39;octocat&amp;#39;][0] &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;Viewer&amp;#39;&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/latest/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;
&lt;h2 id=&#34;configure-github-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure GitHub authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configure-github-authentication&#34;&gt;Configure GitHub authentication&lt;/h3&gt;
&lt;p&gt;To configure GitHub authentication with Grafana, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an OAuth application in GitHub.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the callback URL for your GitHub OAuth app to &lt;code&gt;http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/login/github&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Ensure that the callback URL is the complete HTTP address that you use to access Grafana via your browser, but with the appended path of &lt;code&gt;/login/github&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For the callback URL to be correct, it might be necessary to set the &lt;code&gt;root_url&lt;/code&gt; option in the &lt;code&gt;[server]&lt;/code&gt;section of the Grafana configuration file. For example, if you are serving Grafana behind a proxy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the following table to update field values located in the &lt;code&gt;[auth.github]&lt;/code&gt; section of the Grafana configuration file:&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;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;client_secret&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;These values must match the client ID and client secret from your GitHub OAuth app.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enables GitHub authentication. Set this value to &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Review the list of other GitHub &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; and complete them, as necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team synchronization&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart Grafana.&lt;/p&gt;
&lt;p&gt;You should now see a GitHub login button on the login page and be able to log in or sign up with your GitHub accounts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h3&gt;
&lt;p&gt;Unless the &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role retrieved from GitHub upon user login.&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option.
To map the server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.
Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_mapping&lt;/code&gt; configuration options to assign the user to organizations and specify their role based on their GitHub team membership. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If both org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) and the regular role mapping (&lt;code&gt;role_attribute_path&lt;/code&gt;) are specified, then the user will get the highest of the two mapped roles.&lt;/p&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, go to &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; to test and evaluate expressions with custom payloads.&lt;/p&gt;
&lt;h4 id=&#34;role-mapping-examples&#34;&gt;Role mapping examples&lt;/h4&gt;
&lt;p&gt;This section includes examples of JMESPath expressions used for role mapping.&lt;/p&gt;
&lt;h5 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h5&gt;
&lt;p&gt;The GitHub integration uses the external users&amp;rsquo; teams in the &lt;code&gt;org_mapping&lt;/code&gt; configuration to map organizations and roles based on their GitHub team membership.&lt;/p&gt;
&lt;p&gt;In this example, the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; organization, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; orgs.&lt;/p&gt;
&lt;p&gt;The external user is part of the following GitHub teams: &lt;code&gt;@my-github-organization/my-github-team-1&lt;/code&gt; and &lt;code&gt;@my-github-organization/my-github-team-2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Config:&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 = @my-github-organization/my-github-team-1:org_foo:Viewer @my-github-organization/my-github-team-2:org_bar:Editor *:org_baz:Editor&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-roles-using-github-user-information&#34;&gt;Map roles using GitHub user information&lt;/h5&gt;
&lt;p&gt;In this example, the user with login &lt;code&gt;octocat&lt;/code&gt; has been granted the &lt;code&gt;Admin&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = [login==&amp;#39;octocat&amp;#39;][0] &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-roles-using-github-teams&#34;&gt;Map roles using GitHub teams&lt;/h5&gt;
&lt;p&gt;In this example, the user from GitHub team &lt;code&gt;my-github-team&lt;/code&gt; has been granted the &lt;code&gt;Editor&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = contains(groups[*], &amp;#39;@my-github-organization/my-github-team&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-roles-using-multiple-github-teams&#34;&gt;Map roles using multiple GitHub teams&lt;/h5&gt;
&lt;p&gt;In this example, the users from GitHub teams &lt;code&gt;admins&lt;/code&gt; and &lt;code&gt;devops&lt;/code&gt; have been granted the &lt;code&gt;Admin&lt;/code&gt; role,
the users from GitHub teams &lt;code&gt;engineers&lt;/code&gt; and &lt;code&gt;managers&lt;/code&gt; have been granted the &lt;code&gt;Editor&lt;/code&gt; role,
the users from GitHub team &lt;code&gt;qa&lt;/code&gt; have been granted the &lt;code&gt;Viewer&lt;/code&gt; role and
all other users are granted the &lt;code&gt;None&lt;/code&gt; role.&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;role_attribute_path = contains(groups[*], &amp;#39;@my-github-organization/admins&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(groups[*], &amp;#39;@my-github-organization/devops&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(groups[*], &amp;#39;@my-github-organization/engineers&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || contains(groups[*], &amp;#39;@my-github-organization/managers&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || contains(groups[*], &amp;#39;@my-github-organization/qa&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Viewer&amp;#39; || &amp;#39;None&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-server-administrator-role&#34;&gt;Map server administrator role&lt;/h5&gt;
&lt;p&gt;In this example, the user with login &lt;code&gt;octocat&lt;/code&gt; has been granted the &lt;code&gt;Admin&lt;/code&gt; organization role as well as the Grafana server admin role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = [login==&amp;#39;octocat&amp;#39;][0] &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h5 id=&#34;map-one-role-to-all-users&#34;&gt;Map one role to all users&lt;/h5&gt;
&lt;p&gt;In this example, all users will be assigned &lt;code&gt;Viewer&lt;/code&gt; role regardless of the user information received from the identity provider.&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;role_attribute_path = &amp;#34;&amp;#39;Viewer&amp;#39;&amp;#34;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;example-of-github-configuration-in-grafana&#34;&gt;Example of GitHub configuration in Grafana&lt;/h3&gt;
&lt;p&gt;This section includes an example of GitHub configuration in the Grafana 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;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;[auth.github]
enabled = true
client_id = YOUR_GITHUB_APP_CLIENT_ID
client_secret = YOUR_GITHUB_APP_CLIENT_SECRET
scopes = user:email,read:org
auth_url = https://github.com/login/oauth/authorize
token_url = https://github.com/login/oauth/access_token
api_url = https://api.github.com/user
allow_sign_up = true
auto_login = false
team_ids = 150,300
allowed_organizations = [&amp;#34;My Organization&amp;#34;, &amp;#34;Octocats&amp;#34;]
allowed_domains = mycompany.com mycompany.org
role_attribute_path = [login==&amp;#39;octocat&amp;#39;][0] &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-team-synchronization&#34;&gt;Configure team synchronization&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;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;/products/cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;By using Team Sync, you can map teams from your GitHub organization to teams within Grafana. This will automatically assign users to the appropriate teams.
Teams for each user are synchronized when the user logs in.&lt;/p&gt;
&lt;p&gt;GitHub teams can be referenced in two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https://github.com/orgs/&amp;lt;org&amp;gt;/teams/&amp;lt;slug&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@&amp;lt;org&amp;gt;/&amp;lt;slug&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples: &lt;code&gt;https://github.com/orgs/grafana/teams/developers&lt;/code&gt; or &lt;code&gt;@grafana/developers&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To learn more about Team Sync, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team sync&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The table below describes all GitHub OAuth configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with environment variables&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;If the configuration option requires a JMESPath expression that includes a colon, enclose the entire expression in quotes to prevent parsing errors. For example &lt;code&gt;role_attribute_path: &amp;quot;role:view&amp;quot;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Whether GitHub OAuth 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;Yes&lt;/td&gt;
              &lt;td&gt;Name used to refer to the GitHub authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;GitHub&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for GitHub authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;github&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID provided by your GitHub OAuth app.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret provided by your GitHub OAuth app.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of your GitHub OAuth provider.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://github.com/login/oauth/authorize&lt;/code&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain GitHub OAuth access token.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://github.com/login/oauth/access_token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain GitHub user information compatible with &lt;a href=&#34;https://connect2id.com/products/server/docs/api/userinfo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenID UserInfo&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://api.github.com/user&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated GitHub OAuth scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;user:email,read:org&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;Yes&lt;/td&gt;
              &lt;td&gt;Whether to allow new Grafana user creation through GitHub login. If set to &lt;code&gt;false&lt;/code&gt;, then only existing Grafana users can log in with GitHub OAuth.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;login_prompt&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Indicates the type of user interaction when the user logs in with GitHub. Available values are &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;consent&lt;/code&gt; and &lt;code&gt;select_account&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_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana role lookup. Grafana will first evaluate the expression using the user information obtained from the UserInfo endpoint. If no role is found, Grafana creates a JSON data with &lt;code&gt;groups&lt;/code&gt; key that maps to GitHub teams obtained from GitHub&amp;rsquo;s &lt;a href=&#34;https://docs.github.com/en/rest/teams/teams#list-teams-for-the-authenticated-user&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;/api/user/teams&lt;/code&gt;&lt;/a&gt; endpoint, and evaluates the expression using this data. The result of the evaluation should be a valid Grafana role (&lt;code&gt;None&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Admin&lt;/code&gt; or &lt;code&gt;GrafanaAdmin&lt;/code&gt;). For more information on user role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana org role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt; or &lt;code&gt;org_mapping&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Configure role mapping&lt;/a&gt;.&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;org_mapping&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalGitHubTeamName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles.&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_assign_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable automatic sync of the Grafana server administrator role. If this option is set to &lt;code&gt;true&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user the server administrator privileges and organization administrator role. If this option is set to &lt;code&gt;false&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user only organization administrator role. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;allowed_organizations&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated organizations. User must 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;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated domains. User must belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;team_ids&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Integer list of team IDs. If set, user has to be a member of one of the given teams to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt;, the client accepts any certificate presented by the server and any host name in that certificate. &lt;em&gt;You should only use this for testing&lt;/em&gt;, because this mode leaves SSL/TLS susceptible to man-in-the-middle attacks.&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;tls_client_cert&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_key&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_ca&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the trusted certificate authority list.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&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-github-oauth-authentication">Configure GitHub OAuth authentication&lt;/h1>
&lt;div data-shared="auth/intro.md">
&lt;p>There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p></description></item><item><title>Configure GitLab OAuth authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/gitlab/</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/gitlab/</guid><content><![CDATA[&lt;h1 id=&#34;configure-gitlab-oauth-authentication&#34;&gt;Configure GitLab OAuth authentication&lt;/h1&gt;


&lt;div data-shared=&#34;auth/intro.md&#34;&gt;
            &lt;p&gt;There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p&gt;
&lt;p&gt;When deciding on an authentication method, it&amp;rsquo;s important to take into account your current identity and access management system as well as the specific authentication and authorization features you require.
For a complete list of the available authentication options and the features they support, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/&#34;&gt;Configure authentication&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;

        
&lt;p&gt;This topic describes how to configure GitLab OAuth authentication.&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;If Users use the same email address in GitLab that they use with other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&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 know how to create a GitLab OAuth application. Consult GitLab&amp;rsquo;s documentation on &lt;a href=&#34;https://docs.gitlab.com/ee/integration/oauth_provider.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;creating a GitLab OAuth application&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h3 id=&#34;create-a-gitlab-oauth-application&#34;&gt;Create a GitLab OAuth Application&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Log in to your GitLab account and go to &lt;strong&gt;Profile &amp;gt; Preferences &amp;gt; Applications&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new application&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill out the fields.
&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Redirect URI&lt;/strong&gt; field, enter the following: &lt;code&gt;https://&amp;lt;YOUR-GRAFANA-URL&amp;gt;/login/gitlab&lt;/code&gt; and check &lt;code&gt;openid&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;profile&lt;/code&gt; in the &lt;strong&gt;Scopes&lt;/strong&gt; list.&lt;/li&gt;
&lt;li&gt;Leave the &lt;strong&gt;Confidential&lt;/strong&gt; checkbox checked.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save application&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Note your &lt;strong&gt;Application ID&lt;/strong&gt; (this is the &lt;code&gt;Client Id&lt;/code&gt;) and &lt;strong&gt;Secret&lt;/strong&gt; (this is the &lt;code&gt;Client Secret&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-gitlab-authentication-client-using-the-grafana-ui&#34;&gt;Configure GitLab authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;As a Grafana Admin, you can configure GitLab OAuth client from within Grafana using the GitLab UI. To do this, navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; GitLab&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file then the form will be pre-populated with those values otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt; to save the configuration. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes you made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h2 id=&#34;configure-gitlab-authentication-client-using-the-terraform-provider&#34;&gt;Configure GitLab authentication client using the Terraform provider&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;gitlab_sso_settings&amp;#34; {
  provider_name = &amp;#34;gitlab&amp;#34;
  oauth2_settings {
    name                  = &amp;#34;Gitlab&amp;#34;
    client_id             = &amp;#34;YOUR_GITLAB_APPLICATION_ID&amp;#34;
    client_secret         = &amp;#34;YOUR_GITLAB_APPLICATION_SECRET&amp;#34;
    allow_sign_up         = true
    auto_login            = false
    scopes                = &amp;#34;openid email profile&amp;#34;
    allowed_domains       = &amp;#34;mycompany.com mycompany.org&amp;#34;
    role_attribute_path   = &amp;#34;contains(groups[*], &amp;#39;example-group&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&amp;#34;
    role_attribute_strict = false
    allowed_groups        = &amp;#34;[\&amp;#34;admins\&amp;#34;, \&amp;#34;software engineers\&amp;#34;, \&amp;#34;developers/frontend\&amp;#34;]&amp;#34;
    use_pkce              = true
    use_refresh_token     = true
  }
}&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/latest/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;
&lt;h2 id=&#34;configure-gitlab-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure GitLab authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;p&gt;To configure GitLab authentication with Grafana, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create an OAuth application in GitLab.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set the redirect URI to &lt;code&gt;http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/login/gitlab&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Ensure that the Redirect URI is the complete HTTP address that you use to access Grafana via your browser, but with the appended path of &lt;code&gt;/login/gitlab&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For the Redirect URI to be correct, it might be necessary to set the &lt;code&gt;root_url&lt;/code&gt; option in the &lt;code&gt;[server]&lt;/code&gt;section of the Grafana configuration file. For example, if you are serving Grafana behind a proxy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the OAuth2 scopes to &lt;code&gt;openid&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt; and &lt;code&gt;profile&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the following table to update field values located in the &lt;code&gt;[auth.gitlab]&lt;/code&gt; section of the Grafana configuration file:&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;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;client_secret&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;These values must match the &lt;code&gt;Application ID&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; from your GitLab OAuth application.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enables GitLab authentication. Set this value to &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Review the list of other GitLab &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; and complete them, as necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;a href=&#34;#configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;a. Set &lt;code&gt;use_refresh_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in &lt;code&gt;[auth.gitlab]&lt;/code&gt; section in Grafana configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team synchronization&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart Grafana.&lt;/p&gt;
&lt;p&gt;You should now see a GitLab login button on the login page and be able to log in or sign up with your GitLab accounts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/h3&gt;
&lt;p&gt;When a user logs in using an OAuth provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token.&lt;/p&gt;
&lt;p&gt;Grafana uses a refresh token to obtain a new access token without requiring the user to log in again. If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;By default, GitLab provides a refresh token.&lt;/p&gt;
&lt;p&gt;Refresh token fetching and access token expiration check is enabled by default for the GitLab provider since Grafana v10.1.0. If you would like to disable access token expiration check then set the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value to &lt;code&gt;false&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;The &lt;code&gt;accessTokenExpirationCheck&lt;/code&gt; feature toggle has been removed in Grafana v10.3.0. Use the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value instead for configuring refresh token fetching and access token expiration check.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-jwt-id-token-validation&#34;&gt;Configure JWT ID token validation&lt;/h3&gt;
&lt;p&gt;By default, Grafana extracts user information from ID tokens without validating their cryptographic signatures. To enhance security, you can enable JWT signature validation to ensure that ID tokens are authentic and have not been tampered with.&lt;/p&gt;
&lt;p&gt;To enable JWT ID token validation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set &lt;code&gt;validate_id_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the &lt;code&gt;[auth.gitlab]&lt;/code&gt; section of the Grafana configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;code&gt;jwk_set_url&lt;/code&gt; with the URL of your GitLab instance&amp;rsquo;s JSON Web Key Set (JWKS) endpoint. This endpoint provides the public keys used to verify JWT signatures.&lt;/p&gt;
&lt;p&gt;For GitLab.com, the JWKS endpoint is: &lt;code&gt;https://gitlab.com/oauth/discovery/keys&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For self-hosted GitLab instances, the JWKS endpoint is typically: &lt;code&gt;https://&amp;lt;your-gitlab-domain&amp;gt;/oauth/discovery/keys&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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.gitlab]
enabled = true
validate_id_token = true
jwk_set_url = https://gitlab.com/oauth/discovery/keys
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid email profile&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;When JWT validation is enabled, Grafana caches the JWKS keys to improve performance. The cache respects the &lt;code&gt;Cache-Control&lt;/code&gt; header from the JWKS endpoint response. If no cache expiration is specified, keys are cached for 5 minutes by default.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;If &lt;code&gt;validate_id_token&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt;, you must configure &lt;code&gt;jwk_set_url&lt;/code&gt;. Authentication will fail if the JWK Set URL is not provided or if the ID token signature cannot be verified.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-allowed-groups&#34;&gt;Configure allowed groups&lt;/h3&gt;
&lt;p&gt;To limit access to authenticated users that are members of one or more &lt;a href=&#34;https://docs.gitlab.com/ce/user/group/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GitLab
groups&lt;/a&gt;, set &lt;code&gt;allowed_groups&lt;/code&gt;
to a comma or space-separated list of groups.&lt;/p&gt;
&lt;p&gt;GitLab&amp;rsquo;s groups are referenced by the group name. For example, &lt;code&gt;developers&lt;/code&gt;. To reference a subgroup &lt;code&gt;frontend&lt;/code&gt;, use &lt;code&gt;developers/frontend&lt;/code&gt;.
Note that in GitLab, the group or subgroup name does not always match its display name, especially if the display name contains spaces or special characters.
Make sure you always use the group or subgroup name as it appears in the URL of the group or subgroup.&lt;/p&gt;
&lt;h3 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h3&gt;
&lt;p&gt;Unless &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role retrieved from GitLab upon user login.&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option.
To map the server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.
Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_mapping&lt;/code&gt; configuration option to assign the user to multiple organizations and specify their role based on their GitLab group membership. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If the org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) is specified and Entra ID returns a valid role, then the user will get the highest of the two roles.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, go to &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; to test and evaluate expressions with custom payloads.&lt;/p&gt;
&lt;h3 id=&#34;role-mapping-examples&#34;&gt;Role mapping examples&lt;/h3&gt;
&lt;p&gt;This section includes examples of JMESPath expressions used for role mapping.&lt;/p&gt;
&lt;h5 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h5&gt;
&lt;p&gt;The GitLab integration uses the external users&amp;rsquo; groups in the &lt;code&gt;org_mapping&lt;/code&gt; configuration to map organizations and roles based on their GitLab group membership.&lt;/p&gt;
&lt;p&gt;In this example, the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; organization, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; orgs.&lt;/p&gt;
&lt;p&gt;The external user is part of the following GitLab groups: &lt;code&gt;groupd-1&lt;/code&gt; and &lt;code&gt;group-2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Config:&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 = group-1:org_foo:Viewer groupd-1:org_bar:Editor *:org_baz:Editor&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;map-roles-using-user-information-from-oauth-token&#34;&gt;Map roles using user information from OAuth token&lt;/h4&gt;
&lt;p&gt;In this example, the user with email &lt;code&gt;admin@company.com&lt;/code&gt; has been granted the &lt;code&gt;Admin&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = email==&amp;#39;admin@company.com&amp;#39; &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;map-roles-using-groups&#34;&gt;Map roles using groups&lt;/h4&gt;
&lt;p&gt;In this example, the user from GitLab group &amp;rsquo;example-group&amp;rsquo; have been granted the &lt;code&gt;Editor&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = contains(groups[*], &amp;#39;example-group&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;map-server-administrator-role&#34;&gt;Map server administrator role&lt;/h4&gt;
&lt;p&gt;In this example, the user with email &lt;code&gt;admin@company.com&lt;/code&gt; has been granted the &lt;code&gt;Admin&lt;/code&gt; organization role as well as the Grafana server admin role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = email==&amp;#39;admin@company.com&amp;#39; &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;map-one-role-to-all-users&#34;&gt;Map one role to all users&lt;/h4&gt;
&lt;p&gt;In this example, all users will be assigned &lt;code&gt;Viewer&lt;/code&gt; role regardless of the user information received from the identity provider.&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;role_attribute_path = &amp;#34;&amp;#39;Viewer&amp;#39;&amp;#34;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;example-of-gitlab-configuration-in-grafana&#34;&gt;Example of GitLab configuration in Grafana&lt;/h3&gt;
&lt;p&gt;This section includes an example of GitLab configuration in the Grafana 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;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;[auth.gitlab]
enabled = true
allow_sign_up = true
auto_login = false
client_id = YOUR_GITLAB_APPLICATION_ID
client_secret = YOUR_GITLAB_APPLICATION_SECRET
scopes = openid email profile
auth_url = https://gitlab.com/oauth/authorize
token_url = https://gitlab.com/oauth/token
api_url = https://gitlab.com/api/v4
role_attribute_path = contains(groups[*], &amp;#39;example-group&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;
role_attribute_strict = false
allow_assign_grafana_admin = false
allowed_groups = [&amp;#34;admins&amp;#34;, &amp;#34;software engineers&amp;#34;, &amp;#34;developers/frontend&amp;#34;]
allowed_domains = mycompany.com mycompany.org
tls_skip_verify_insecure = false
use_pkce = true
use_refresh_token = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-team-synchronization&#34;&gt;Configure team synchronization&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;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;/products/cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;By using Team Sync, you can map GitLab groups to teams within Grafana. This will automatically assign users to the appropriate teams.
Teams for each user are synchronized when the user logs in.&lt;/p&gt;
&lt;p&gt;GitLab groups are referenced by the group name. For example, &lt;code&gt;developers&lt;/code&gt;. To reference a subgroup &lt;code&gt;frontend&lt;/code&gt;, use &lt;code&gt;developers/frontend&lt;/code&gt;.
Note that in GitLab, the group or subgroup name does not always match its display name, especially if the display name contains spaces or special characters.
Make sure you always use the group or subgroup name as it appears in the URL of the group or subgroup.&lt;/p&gt;
&lt;p&gt;To learn more about Team Sync, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure team sync&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table describes all GitLab OAuth configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with environment variables&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;If the configuration option requires a JMESPath expression that includes a colon, enclose the entire expression in quotes to prevent parsing errors. For example &lt;code&gt;role_attribute_path: &amp;quot;role:view&amp;quot;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Whether GitLab OAuth 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;client_id&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID provided by your GitLab OAuth app.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret provided by your GitLab OAuth app.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of your GitLab OAuth provider. If you use your own instance of GitLab instead of gitlab.com, adjust &lt;code&gt;auth_url&lt;/code&gt; by replacing the &lt;code&gt;gitlab.com&lt;/code&gt; hostname with your own.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://gitlab.com/oauth/authorize&lt;/code&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain GitLab OAuth access token. If you use your own instance of GitLab instead of gitlab.com, adjust &lt;code&gt;token_url&lt;/code&gt; by replacing the &lt;code&gt;gitlab.com&lt;/code&gt; hostname with your own.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://gitlab.com/oauth/token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Grafana uses &lt;code&gt;&amp;lt;api_url&amp;gt;/user&lt;/code&gt; endpoint to obtain GitLab user information compatible with &lt;a href=&#34;https://connect2id.com/products/server/docs/api/userinfo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenID UserInfo&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://gitlab.com/api/v4&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;Yes&lt;/td&gt;
              &lt;td&gt;Name used to refer to the GitLab authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;GitLab&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for GitLab authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;gitlab&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma or space-separated GitLab OAuth scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;openid email profile&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;Yes&lt;/td&gt;
              &lt;td&gt;Whether to allow new Grafana user creation through GitLab login. If set to &lt;code&gt;false&lt;/code&gt;, then only existing Grafana users can log in with GitLab OAuth.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;login_prompt&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Indicates the type of user interaction when the user logs in with GitLab. Available values are &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;consent&lt;/code&gt; and &lt;code&gt;select_account&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_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana role lookup. Grafana will first evaluate the expression using the GitLab OAuth token. If no role is found, Grafana creates a JSON data with &lt;code&gt;groups&lt;/code&gt; key that maps to groups obtained from GitLab&amp;rsquo;s &lt;code&gt;/oauth/userinfo&lt;/code&gt; endpoint, and evaluates the expression using this data. Finally, if a valid role is still not found, the expression is evaluated against the user information retrieved from &lt;code&gt;api_url/users&lt;/code&gt; endpoint and groups retrieved from &lt;code&gt;api_url/groups&lt;/code&gt; endpoint. The result of the evaluation should be a valid Grafana role (&lt;code&gt;None&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Admin&lt;/code&gt; or &lt;code&gt;GrafanaAdmin&lt;/code&gt;). For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;org_mapping&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalGitlabGroupName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles.&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_assign_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable automatic sync of the Grafana server administrator role. If this option is set to &lt;code&gt;true&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user the server administrator privileges and organization administrator role. If this option is set to &lt;code&gt;false&lt;/code&gt; and the result of evaluating &lt;code&gt;role_attribute_path&lt;/code&gt; for a user is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user only organization administrator role. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma or space-separated domains. User must belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma or space-separated groups. The user should be a member of at least one group to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt;, the client accepts any certificate presented by the server and any host name in that certificate. &lt;em&gt;You should only use this for testing&lt;/em&gt;, because this mode leaves SSL/TLS susceptible to man-in-the-middle attacks.&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;tls_client_cert&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_key&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_ca&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the trusted certificate authority list.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;use_pkce&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Proof Key for Code Exchange (PKCE)&lt;/a&gt;. Grafana uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&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;use_refresh_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use refresh token and check access token expiration. The &lt;code&gt;accessTokenExpirationCheck&lt;/code&gt; feature toggle should also be enabled to use refresh token.&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;validate_id_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;If enabled, Grafana will validate the JWT signature of ID tokens using the JWKS endpoint. This enhances security by ensuring tokens are authentic and have not been tampered with.&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;jwk_set_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL of the JSON Web Key Set (JWKS) endpoint used to verify JWT ID token signatures. Required when ID token validation is enabled. For GitLab.com, use &lt;code&gt;https://gitlab.com/oauth/discovery/keys&lt;/code&gt;. For self-hosted GitLab instances, use &lt;code&gt;https://&amp;lt;your-gitlab-domain&amp;gt;/oauth/discovery/keys&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&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-gitlab-oauth-authentication">Configure GitLab OAuth authentication&lt;/h1>
&lt;div data-shared="auth/intro.md">
&lt;p>There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p></description></item><item><title>Configure Google OAuth authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/google/</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/google/</guid><content><![CDATA[&lt;h1 id=&#34;configure-google-oauth-authentication&#34;&gt;Configure Google OAuth authentication&lt;/h1&gt;
&lt;p&gt;To enable Google OAuth you must register your application with Google. Google will generate a client ID and secret key for you to use.&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;If Users use the same email address in Google that they use with other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;create-google-oauth-keys&#34;&gt;Create Google OAuth keys&lt;/h2&gt;
&lt;p&gt;First, you need to create a Google OAuth Client:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;a href=&#34;https://console.developers.google.com/apis/credentials&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://console.developers.google.com/apis/credentials&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a new project if you don&amp;rsquo;t have one already.
&lt;ol&gt;
&lt;li&gt;Enter a project name. The &lt;strong&gt;Organization&lt;/strong&gt; and &lt;strong&gt;Location&lt;/strong&gt; fields should both be set to your organization&amp;rsquo;s information.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;OAuth consent screen&lt;/strong&gt; select the &lt;strong&gt;External&lt;/strong&gt; User Type. Click &lt;strong&gt;CREATE&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill out the requested information using the URL of your Grafana Cloud instance.&lt;/li&gt;
&lt;li&gt;Accept the defaults, or customize the consent screen options.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Credentials&lt;/strong&gt;, then click &lt;strong&gt;OAuth Client ID&lt;/strong&gt; in the drop-down menu&lt;/li&gt;
&lt;li&gt;Enter the following:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Application Type&lt;/strong&gt;: Web application&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt;: Grafana&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authorized JavaScript origins&lt;/strong&gt;: &lt;code&gt;https://&amp;lt;YOUR_GRAFANA_URL&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authorized redirect URIs&lt;/strong&gt;: &lt;code&gt;https://&amp;lt;YOUR_GRAFANA_URL&amp;gt;/login/google&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Replace &lt;code&gt;&amp;lt;YOUR_GRAFANA_URL&amp;gt;&lt;/code&gt; with the URL of your Grafana instance.


&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 URL you enter is the one for your Grafana instance home page, not your Grafana Cloud portal URL.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click Create&lt;/li&gt;
&lt;li&gt;Copy the Client ID and Client Secret from the &amp;lsquo;OAuth Client&amp;rsquo; modal&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-google-authentication-client-using-the-grafana-ui&#34;&gt;Configure Google authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;As a Grafana Admin, you can configure Google OAuth client from within Grafana using the Google UI. To do this, navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; Google&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file then the form will be pre-populated with those values otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt;. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;configure-google-authentication-client-using-the-terraform-provider&#34;&gt;Configure Google authentication client using the Terraform provider&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;google_sso_settings&amp;#34; {
  provider_name = &amp;#34;google&amp;#34;
  oauth2_settings {
    name            = &amp;#34;Google&amp;#34;
    client_id       = &amp;#34;CLIENT_ID&amp;#34;
    client_secret   = &amp;#34;CLIENT_SECRET&amp;#34;
    allow_sign_up   = true
    auto_login      = false
    scopes          = &amp;#34;openid email profile&amp;#34;
    allowed_domains = &amp;#34;mycompany.com mycompany.org&amp;#34;
    hosted_domain   = &amp;#34;mycompany.com&amp;#34;
    use_pkce        = true
  }
}&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/latest/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;
&lt;h2 id=&#34;configure-google-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure Google authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;enable-google-oauth-in-grafana&#34;&gt;Enable Google OAuth in Grafana&lt;/h3&gt;
&lt;p&gt;Specify the Client ID and Secret in the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;. For 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;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;[auth.google]
enabled = true
allow_sign_up = true
auto_login = false
client_id = CLIENT_ID
client_secret = CLIENT_SECRET
scopes = openid email profile
auth_url = https://accounts.google.com/o/oauth2/v2/auth
token_url = https://oauth2.googleapis.com/token
api_url = https://openidconnect.googleapis.com/v1/userinfo
allowed_domains = mycompany.com mycompany.org
hosted_domain = mycompany.com
use_pkce = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You may have to set the &lt;code&gt;root_url&lt;/code&gt; option of &lt;code&gt;[server]&lt;/code&gt; for the callback URL to be
correct. For example, in case you are serving Grafana behind a proxy.&lt;/p&gt;
&lt;p&gt;Restart the Grafana backend. You should now see a Google login button
on the login page. You can now login or sign up with your Google
accounts. The &lt;code&gt;allowed_domains&lt;/code&gt; option is optional, and domains were separated by space.&lt;/p&gt;
&lt;p&gt;You may allow users to sign-up via Google authentication by setting the
&lt;code&gt;allow_sign_up&lt;/code&gt; option to &lt;code&gt;true&lt;/code&gt;. When this option is set to &lt;code&gt;true&lt;/code&gt;, any
user successfully authenticating via Google authentication will be
automatically signed up.&lt;/p&gt;
&lt;p&gt;You may specify a domain to be passed as &lt;code&gt;hd&lt;/code&gt; query parameter accepted by Google&amp;rsquo;s
OAuth 2.0 authentication API. Refer to Google&amp;rsquo;s OAuth &lt;a href=&#34;https://developers.google.com/identity/openid-connect/openid-connect#hd-param&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;documentation&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;Since Grafana 10.3.0, the &lt;code&gt;hd&lt;/code&gt; parameter retrieved from Google ID token is also used to determine the user&amp;rsquo;s hosted domain. The Google Oauth &lt;code&gt;allowed_domains&lt;/code&gt; configuration option is used to restrict access to users from a specific domain. If the &lt;code&gt;allowed_domains&lt;/code&gt; configuration option is set, the &lt;code&gt;hd&lt;/code&gt; parameter from the Google ID token must match the &lt;code&gt;allowed_domains&lt;/code&gt; configuration option. If the &lt;code&gt;hd&lt;/code&gt; parameter from the Google ID token does not match the &lt;code&gt;allowed_domains&lt;/code&gt; configuration option, the user is denied access.&lt;/p&gt;
&lt;p&gt;When an account does not belong to a google workspace, the &lt;code&gt;hd&lt;/code&gt; claim will not be available.&lt;/p&gt;
&lt;p&gt;This validation is enabled by default. To disable this validation, set the &lt;code&gt;validate_hd&lt;/code&gt; configuration option to &lt;code&gt;false&lt;/code&gt;. The &lt;code&gt;allowed_domains&lt;/code&gt; configuration option will use the email claim to validate the domain.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;pkce&#34;&gt;PKCE&lt;/h4&gt;
&lt;p&gt;IETF&amp;rsquo;s &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RFC 7636&lt;/a&gt;
introduces &amp;ldquo;proof key for code exchange&amp;rdquo; (PKCE) which provides
additional protection against some forms of authorization code
interception attacks. PKCE will be required in &lt;a href=&#34;https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-03&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OAuth 2.1&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;You can disable PKCE in Grafana by setting &lt;code&gt;use_pkce&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in the&lt;code&gt;[auth.google]&lt;/code&gt; section.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-refresh-token&#34;&gt;Configure refresh token&lt;/h4&gt;
&lt;p&gt;When a user logs in using an OAuth provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token.&lt;/p&gt;
&lt;p&gt;Grafana uses a refresh token to obtain a new access token without requiring the user to log in again. If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;By default, Grafana includes the &lt;code&gt;access_type=offline&lt;/code&gt; parameter in the authorization request to request a refresh token.&lt;/p&gt;
&lt;p&gt;Refresh token fetching and access token expiration check is enabled by default for the Google provider since Grafana v10.1.0. If you would like to disable access token expiration check then set the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value to &lt;code&gt;false&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;The &lt;code&gt;accessTokenExpirationCheck&lt;/code&gt; feature toggle has been removed in Grafana v10.3.0 and the &lt;code&gt;use_refresh_token&lt;/code&gt; configuration value will be used instead for configuring refresh token fetching and access token expiration check.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-jwt-id-token-validation&#34;&gt;Configure JWT ID token validation&lt;/h4&gt;
&lt;p&gt;By default, Grafana extracts user information from ID tokens without validating their cryptographic signatures. To enhance security, you can enable JWT signature validation to ensure that ID tokens are authentic and have not been tampered with.&lt;/p&gt;
&lt;p&gt;To enable JWT ID token validation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set &lt;code&gt;validate_id_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the &lt;code&gt;[auth.google]&lt;/code&gt; section of the Grafana configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;code&gt;jwk_set_url&lt;/code&gt; with the URL of Google&amp;rsquo;s JSON Web Key Set (JWKS) endpoint. This endpoint provides the public keys used to verify JWT signatures.&lt;/p&gt;
&lt;p&gt;For Google, the JWKS endpoint is: &lt;code&gt;https://www.googleapis.com/oauth2/v3/certs&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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.google]
enabled = true
validate_id_token = true
jwk_set_url = https://www.googleapis.com/oauth2/v3/certs
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid email profile&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;When JWT validation is enabled, Grafana caches the JWKS keys to improve performance. The cache respects the &lt;code&gt;Cache-Control&lt;/code&gt; header from the JWKS endpoint response. If no cache expiration is specified, keys are cached for 5 minutes by default.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;If &lt;code&gt;validate_id_token&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt;, you must configure &lt;code&gt;jwk_set_url&lt;/code&gt;. Authentication will fail if the JWK Set URL is not provided or if the ID token signature cannot be verified.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-automatic-login&#34;&gt;Configure automatic login&lt;/h4&gt;
&lt;p&gt;Set the &lt;code&gt;auto_login&lt;/code&gt; option to true to attempt log in automatically, skipping the login screen.
This setting is ignored if multiple auth providers are configured to use auto login.&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;h3 id=&#34;configure-team-synchronization&#34;&gt;Configure team synchronization&lt;/h3&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;/products/cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;With team sync, you can easily add users to teams by utilizing their Google groups. To set up team sync for Google OAuth, refer to the following example.&lt;/p&gt;
&lt;p&gt;To set up team sync for Google OAuth:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Enable the Google Cloud Identity API on your &lt;a href=&#34;https://console.cloud.google.com/apis/api/cloudidentity.googleapis.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;organization&amp;rsquo;s dashboard&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the &lt;code&gt;https://www.googleapis.com/auth/cloud-identity.groups.readonly&lt;/code&gt; scope to your Grafana &lt;code&gt;[auth.google]&lt;/code&gt; configuration:&lt;/p&gt;
&lt;p&gt;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;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.google]
# ..
scopes = openid email profile https://www.googleapis.com/auth/cloud-identity.groups.readonly&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure team sync in your Grafana team&amp;rsquo;s &lt;code&gt;External group sync&lt;/code&gt; tab.
The external group ID for a Google group is the group&amp;rsquo;s email address, such as &lt;code&gt;dev@grafana.com&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To learn more about Team Sync, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure Team Sync&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;configure-allowed-groups&#34;&gt;Configure allowed groups&lt;/h4&gt;
&lt;p&gt;To limit access to authenticated users that are members of one or more groups, set &lt;code&gt;allowed_groups&lt;/code&gt;
to a comma or space separated list of groups.&lt;/p&gt;
&lt;p&gt;Google groups are referenced by the group email key. For example, &lt;code&gt;developers@google.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;Add the &lt;code&gt;https://www.googleapis.com/auth/cloud-identity.groups.readonly&lt;/code&gt; scope to your Grafana &lt;code&gt;[auth.google]&lt;/code&gt; scopes configuration to retrieve groups.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h4&gt;
&lt;p&gt;Unless the &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role mapped from Google upon user login. If no mapping is set the default instance role is used.&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option.
To map the server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, go to &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; to test and evaluate expressions with custom payloads.


&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;By default the &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled. The &lt;code&gt;skip_org_role_sync&lt;/code&gt; option defaults to false in Grafana v10.3.0 and later versions.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;h5 id=&#34;role-mapping-examples&#34;&gt;Role mapping examples&lt;/h5&gt;
&lt;p&gt;This section includes examples of JMESPath expressions used for role mapping.&lt;/p&gt;
&lt;h5 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h5&gt;
&lt;p&gt;The Google integration uses the external users&amp;rsquo; groups in the &lt;code&gt;org_mapping&lt;/code&gt; configuration to map organizations and roles based on their Google group membership.&lt;/p&gt;
&lt;p&gt;In this example, the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; organization, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; orgs.&lt;/p&gt;
&lt;p&gt;The external user is part of the following Google groups: &lt;code&gt;group-1&lt;/code&gt; and &lt;code&gt;group-2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Config:&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 = group-1:org_foo:Viewer group-2:org_bar:Editor *:org_baz:Editor&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h6 id=&#34;map-roles-using-user-information-from-oauth-token&#34;&gt;Map roles using user information from OAuth token&lt;/h6&gt;
&lt;p&gt;In this example, the user with email &lt;code&gt;admin@company.com&lt;/code&gt; has been granted the &lt;code&gt;Admin&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = email==&amp;#39;admin@company.com&amp;#39; &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || &amp;#39;Viewer&amp;#39;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h6 id=&#34;map-roles-using-groups&#34;&gt;Map roles using groups&lt;/h6&gt;
&lt;p&gt;In this example, the user from Google group &amp;rsquo;&lt;a href=&#34;mailto:example-group@google.com&#34;&gt;example-group@google.com&lt;/a&gt;&amp;rsquo; have been granted the &lt;code&gt;Editor&lt;/code&gt; role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;role_attribute_path = contains(groups[*], &amp;#39;example-group@google.com&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Add the &lt;code&gt;https://www.googleapis.com/auth/cloud-identity.groups.readonly&lt;/code&gt; scope to your Grafana &lt;code&gt;[auth.google]&lt;/code&gt; scopes configuration to retrieve groups.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h6 id=&#34;map-server-administrator-role&#34;&gt;Map server administrator role&lt;/h6&gt;
&lt;p&gt;In this example, the user with email &lt;code&gt;admin@company.com&lt;/code&gt; is granted the &lt;code&gt;Admin&lt;/code&gt; organization role as well as the Grafana server admin role.
All other users are granted the &lt;code&gt;Viewer&lt;/code&gt; role.&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;allow_assign_grafana_admin = true
skip_org_role_sync = false
role_attribute_path = email==&amp;#39;admin@company.com&amp;#39; &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h6 id=&#34;map-one-role-to-all-users&#34;&gt;Map one role to all users&lt;/h6&gt;
&lt;p&gt;In this example, all users are assigned the &lt;code&gt;Viewer&lt;/code&gt; role regardless of the user information received from the identity provider.&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;role_attribute_path = &amp;#34;&amp;#39;Viewer&amp;#39;&amp;#34;
skip_org_role_sync = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table outlines the various Google OAuth configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with 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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Enables Google authentication.&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;Yes&lt;/td&gt;
              &lt;td&gt;Name that refers to the Google authentication from the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Google&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for the Google authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;google&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID of the App.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret of the App.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of the Google OAuth provider.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://accounts.google.com/o/oauth2/v2/auth&lt;/code&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain the OAuth2 access token.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://oauth2.googleapis.com/token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain user information compatible with &lt;a href=&#34;https://connect2id.com/products/server/docs/api/userinfo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenID UserInfo&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;https://openidconnect.googleapis.com/v1/userinfo&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_style&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Name of the &lt;a href=&#34;https://pkg.go.dev/golang.org/x/oauth2#AuthStyle&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OAuth2 AuthStyle&lt;/a&gt; to be used when ID token is requested from OAuth2 provider. It determines how &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;client_secret&lt;/code&gt; are sent to Oauth2 provider. Available values are &lt;code&gt;AutoDetect&lt;/code&gt;, &lt;code&gt;InParams&lt;/code&gt; and &lt;code&gt;InHeader&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;AutoDetect&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated OAuth2 scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;openid email profile&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;Yes&lt;/td&gt;
              &lt;td&gt;Controls Grafana user creation through the Google login. Only existing Grafana users can log in with Google if set to &lt;code&gt;false&lt;/code&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;login_prompt&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Indicates the type of user interaction when the user logs in with Google. Available values are &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;consent&lt;/code&gt; and &lt;code&gt;select_account&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;hosted_domain&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Specifies the domain to restrict access to users from that domain. This value is appended to the authorization request using the &lt;code&gt;hd&lt;/code&gt; parameter.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;validate_hd&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;false&lt;/code&gt; to disable the validation of the &lt;code&gt;hd&lt;/code&gt; parameter from the Google ID token. For more informatiion, refer to &lt;a href=&#34;#enable-google-oauth-in-grafana&#34;&gt;Enable Google OAuth in Grafana&lt;/a&gt;.&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;role_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana org role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt; or &lt;code&gt;org_mapping&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;org_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana org to role lookup. Grafana will first evaluate the expression using the OAuth2 ID token. If no value is returned, the expression will be evaluated using the user information obtained from the UserInfo endpoint. The result of the evaluation will be mapped to org roles based on &lt;code&gt;org_mapping&lt;/code&gt;. For more information on org to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalOrgName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allow_assign_grafana_admin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to automatically sync the Grafana server administrator role. When enabled, if the Google user&amp;rsquo;s App role is &lt;code&gt;GrafanaAdmin&lt;/code&gt;, Grafana grants the user server administrator privileges and the organization administrator role. If disabled, the user will only receive the organization administrator role. For more details on user role mapping, refer to &lt;a href=&#34;#map-roles&#34;&gt;Map roles&lt;/a&gt;.&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;skip_org_role_sync&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles. This will allow you to set organization roles for your users from within Grafana manually.&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;allowed_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated groups. The user should be a member of at least one group to log in. If you configure &lt;code&gt;allowed_groups&lt;/code&gt;, you must also configure Google to include the &lt;code&gt;groups&lt;/code&gt; claim following &lt;a href=&#34;#configure-allowed-groups&#34;&gt;Configure allowed groups&lt;/a&gt;.&lt;/td&gt;
              &lt;td&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;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated Azure tenant identifiers. The user should be a member of at least one tenant to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated domains. The user should belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt;, the client accepts any certificate presented by the server and any host name in that certificate. &lt;em&gt;You should only use this for testing&lt;/em&gt;, because this mode leaves SSL/TLS susceptible to man-in-the-middle attacks.&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;tls_client_cert&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the certificate.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_key&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the key.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tls_client_ca&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The path to the trusted certificate authority list.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;use_pkce&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Proof Key for Code Exchange (PKCE)&lt;/a&gt;. Grafana uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&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;use_refresh_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Enables the use of refresh tokens and checks for access token expiration. When enabled, Grafana automatically adds the &lt;code&gt;promp=consent&lt;/code&gt; and &lt;code&gt;access_type=offline&lt;/code&gt; parameters to the authorization request.&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;validate_id_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;If enabled, Grafana will validate the JWT signature of ID tokens using the JWKS endpoint. This enhances security by ensuring tokens are authentic and have not been tampered with.&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;jwk_set_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL of the JSON Web Key Set (JWKS) endpoint used to verify JWT ID token signatures. Required when ID token validation is enabled. For Google, use &lt;code&gt;https://www.googleapis.com/oauth2/v3/certs&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&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-google-oauth-authentication">Configure Google OAuth authentication&lt;/h1>
&lt;p>To enable Google OAuth you must register your application with Google. Google will generate a client ID and secret key for you to use.&lt;/p></description></item><item><title>Configure Grafana Cloud authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/grafana-cloud/</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/grafana-cloud/</guid><content><![CDATA[&lt;h1 id=&#34;configure-grafana-cloud-authentication&#34;&gt;Configure Grafana Cloud authentication&lt;/h1&gt;
&lt;p&gt;To enable Grafana Cloud as the Identity Provider for a Grafana instance, generate a client ID and client secret and apply the configuration to Grafana.&lt;/p&gt;
&lt;h2 id=&#34;create-grafana-cloud-oauth-client-credentials&#34;&gt;Create Grafana Cloud OAuth Client Credentials&lt;/h2&gt;
&lt;p&gt;To use Grafana Cloud authentication:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Log in to &lt;a href=&#34;/&#34;&gt;Grafana Cloud&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To create an OAuth client, locate your organization and click &lt;strong&gt;OAuth Clients&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add OAuth Client Application&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Add the name and URL of your running Grafana instance.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add OAuth Client&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Copy the client ID and client secret or the configuration that has been generated.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following snippet shows an 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.grafana_com]
enabled = true
allow_sign_up = true
auto_login = false
client_id = 450bc21c10dc2194879d
client_secret = eyJ0Ijoib2F1dGgyYyIhlmlkIjoiNzUwYmMzM2MxMGRjMjE6NDh3OWQiLCJ2IjoiZmI1YzVlYmIwYzFmN2ZhYzZmNjIwOGI1NmVkYTRlNWYxMzgwM2NkMiJ9
scopes = user:email
allowed_organizations = sampleorganization
enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-automatic-login&#34;&gt;Configure automatic login&lt;/h3&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;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;skip-organization-role-sync&#34;&gt;Skip organization role sync&lt;/h2&gt;
&lt;p&gt;If a user signs in with their Grafana Cloud credentials, their assigned org role overrides the role defined in the Grafana instance. To prevent Grafana Cloud roles from synchronizing, set &lt;code&gt;skip_org_role_sync&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;. This is useful if you want to manage the organization roles for your users from within Grafana.&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.grafana_com]
# ..
# prevents the sync of org roles from Grafana.com
skip_org_role_sync = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-grafana-cloud-authentication">Configure Grafana Cloud authentication&lt;/h1>
&lt;p>To enable Grafana Cloud as the Identity Provider for a Grafana instance, generate a client ID and client secret and apply the configuration to Grafana.&lt;/p></description></item><item><title>Configure Keycloak OAuth2 authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/keycloak/</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/keycloak/</guid><content><![CDATA[&lt;h1 id=&#34;configure-keycloak-oauth2-authentication&#34;&gt;Configure Keycloak OAuth2 authentication&lt;/h1&gt;
&lt;p&gt;Keycloak OAuth2 authentication allows users to log in to Grafana using their Keycloak credentials. This guide explains how to set up Keycloak as an authentication provider in Grafana.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../generic-oauth/&#34;&gt;Generic OAuth authentication&lt;/a&gt; for extra configuration options available for this provider.&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;If you use the same email address in Keycloak as in other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;You may have to set the &lt;code&gt;root_url&lt;/code&gt; option of &lt;code&gt;[server]&lt;/code&gt; for the callback URL to be
correct. For example in case you are serving Grafana behind a proxy.&lt;/p&gt;
&lt;p&gt;Example config:&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.generic_oauth]
enabled = true
name = Keycloak-OAuth
allow_sign_up = true
client_id = YOUR_APP_CLIENT_ID
client_secret = YOUR_APP_CLIENT_SECRET
scopes = openid email profile offline_access roles
email_attribute_path = email
login_attribute_path = username
name_attribute_path = full_name
auth_url = https://&amp;lt;PROVIDER_DOMAIN&amp;gt;/realms/&amp;lt;REALM_NAME&amp;gt;/protocol/openid-connect/auth
token_url = https://&amp;lt;PROVIDER_DOMAIN&amp;gt;/realms/&amp;lt;REALM_NAME&amp;gt;/protocol/openid-connect/token
api_url = https://&amp;lt;PROVIDER_DOMAIN&amp;gt;/realms/&amp;lt;REALM_NAME&amp;gt;/protocol/openid-connect/userinfo
role_attribute_path = contains(roles[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(roles[*], &amp;#39;editor&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As an example, &lt;code&gt;&amp;lt;PROVIDER_DOMAIN&amp;gt;&lt;/code&gt; can be &lt;code&gt;keycloak-demo.grafana.org&lt;/code&gt;
and &lt;code&gt;&amp;lt;REALM_NAME&amp;gt;&lt;/code&gt; can be &lt;code&gt;grafana&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To configure the &lt;code&gt;kc_idp_hint&lt;/code&gt; parameter for Keycloak, you need to change the &lt;code&gt;auth_url&lt;/code&gt; configuration to include the &lt;code&gt;kc_idp_hint&lt;/code&gt; parameter. For example if you want to hint the Google identity provider:&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_url = https://&amp;lt;PROVIDER_DOMAIN&amp;gt;/realms/&amp;lt;REALM_NAME&amp;gt;/protocol/openid-connect/auth?kc_idp_hint=google&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;api_url is not required if the id_token contains all the necessary user information and can add latency to the login process.
It is useful as a fallback or if the user has more than 150 group memberships.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;keycloak-configuration&#34;&gt;Keycloak configuration&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create a client in Keycloak with the following settings:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Client ID: &lt;code&gt;grafana-oauth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enabled: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Client Protocol: &lt;code&gt;openid-connect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Access Type: &lt;code&gt;confidential&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Standard Flow Enabled: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Implicit Flow Enabled: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Direct Access Grants Enabled: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Root URL: &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Valid Redirect URIs: &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;/login/generic_oauth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Web Origins: &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Admin URL: &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Base URL: &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As an example, &lt;code&gt;&amp;lt;grafana_root_url&amp;gt;&lt;/code&gt; can be &lt;code&gt;https://play.grafana.org&lt;/code&gt;.
Non-listed configuration options can be left at their default values.&lt;/p&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;In the client scopes configuration, &lt;em&gt;Assigned Default Client Scopes&lt;/em&gt; should match:&lt;/li&gt;
&lt;/ol&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;email
offline_access
profile
roles&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;These scopes do not add group claims to the &lt;code&gt;id_token&lt;/code&gt;. Without group claims, teamsync will not work. Teamsync is covered further down in this document.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;For role mapping to work with the example configuration above,
you need to create the following roles and assign them to users:&lt;/li&gt;
&lt;/ol&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;admin
editor
viewer&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;team-sync&#34;&gt;Team sync&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;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;/products/cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Team Sync&lt;/a&gt; is a feature that allows you to map groups from your identity provider to Grafana teams. This is useful if you want to give your users access to specific dashboards or folders based on their group membership.&lt;/p&gt;
&lt;p&gt;To enable teamsync, you need to add a &lt;code&gt;groups&lt;/code&gt; mapper to the client configuration in Keycloak.
This will add the &lt;code&gt;groups&lt;/code&gt; claim to the id_token. You can then use the &lt;code&gt;groups&lt;/code&gt; claim to map groups to teams in Grafana.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the client configuration, head to &lt;code&gt;Mappers&lt;/code&gt; and create a mapper with the following settings:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;Group Mapper&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Mapper Type: &lt;code&gt;Group Membership&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Token Claim Name: &lt;code&gt;groups&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Full group path: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to ID token: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to access token: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to userinfo: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;In Grafana&amp;rsquo;s configuration add the following option:&lt;/li&gt;
&lt;/ol&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.generic_oauth]
groups_attribute_path = groups&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you use nested groups containing special characters such as quotes or colons, the JMESPath parser can perform a harmless reverse function so Grafana can properly evaluate nested groups. The following example shows a parent group named &lt;code&gt;Global&lt;/code&gt; with nested group &lt;code&gt;department&lt;/code&gt; that contains a list of groups:&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.generic_oauth]
groups_attribute_path = reverse(&amp;#34;Global:department&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;enable-single-logout&#34;&gt;Enable Single Logout&lt;/h2&gt;
&lt;p&gt;To enable Single Logout, you need to add the following option to the configuration of Grafana:&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.generic_oauth]
signout_redirect_url = https://&amp;lt;PROVIDER_DOMAIN&amp;gt;/realms/&amp;lt;REALM_NAME&amp;gt;/protocol/openid-connect/logout?post_logout_redirect_uri=https%3A%2F%2F&amp;lt;GRAFANA_DOMAIN&amp;gt;%2Flogin&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As an example, &lt;code&gt;&amp;lt;PROVIDER_DOMAIN&amp;gt;&lt;/code&gt; can be &lt;code&gt;keycloak-demo.grafana.org&lt;/code&gt;,
&lt;code&gt;&amp;lt;REALM_NAME&amp;gt;&lt;/code&gt; can be &lt;code&gt;grafana&lt;/code&gt; and &lt;code&gt;&amp;lt;GRAFANA_DOMAIN&amp;gt;&lt;/code&gt; can be &lt;code&gt;play.grafana.org&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;Grafana supports ID token hints for single logout. Grafana automatically adds the &lt;code&gt;id_token_hint&lt;/code&gt; parameter to the logout request if it detects OAuth as the authentication method.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;allow-assigning-grafana-admin&#34;&gt;Allow assigning Grafana Admin&lt;/h2&gt;
&lt;p&gt;If the application role received by Grafana is &lt;code&gt;GrafanaAdmin&lt;/code&gt; , Grafana grants the user server administrator privileges.&lt;/p&gt;
&lt;p&gt;This is useful if you want to grant server administrator privileges to a subset of users.
Grafana also assigns the user the &lt;code&gt;Admin&lt;/code&gt; role of the default organization.&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;role_attribute_path = contains(roles[*], &amp;#39;grafanaadmin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;GrafanaAdmin&amp;#39; || contains(roles[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(roles[*], &amp;#39;editor&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;
allow_assign_grafana_admin = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-refresh-token&#34;&gt;Configure refresh token&lt;/h3&gt;
&lt;p&gt;When a user logs in using an OAuth provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token.&lt;/p&gt;
&lt;p&gt;Grafana uses a refresh token to obtain a new access token without requiring the user to log in again. If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;To enable a refresh token for Keycloak, do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Extend the &lt;code&gt;scopes&lt;/code&gt; in &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; with &lt;code&gt;offline_access&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;code&gt;use_refresh_token = true&lt;/code&gt; to &lt;code&gt;[auth.generic_oauth]&lt;/code&gt; configuration.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="configure-keycloak-oauth2-authentication">Configure Keycloak OAuth2 authentication&lt;/h1>
&lt;p>Keycloak OAuth2 authentication allows users to log in to Grafana using their Keycloak credentials. This guide explains how to set up Keycloak as an authentication provider in Grafana.&lt;/p></description></item><item><title>Multiple providers with Keycloak in Grafana</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/keycloak-multitenant/</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/keycloak-multitenant/</guid><content><![CDATA[&lt;h1 id=&#34;multiple-providers-with-keycloak-in-grafana&#34;&gt;Multiple providers with Keycloak in Grafana&lt;/h1&gt;
&lt;p&gt;While Grafana offers a variety of authentication providers, you can only configure one provider of one type at a time. However, you can configure multiple providers of the same type with the help of Keycloak.&lt;/p&gt;
&lt;p&gt;This guide explains how to set up multiple providers of the same type with Keycloak as an authentication provider in Grafana.&lt;/p&gt;
&lt;p&gt;The idea is to set up multiple OIDC providers in Keycloak with different tenants and configure Grafana to use the same Keycloak instance as the authentication provider.&lt;/p&gt;
&lt;h2 id=&#34;entra-id-configuration&#34;&gt;Entra ID configuration&lt;/h2&gt;
&lt;p&gt;For Entra ID, repeat the following steps for each tenant you want to set up in Keycloak.&lt;/p&gt;
&lt;h3 id=&#34;overview&#34;&gt;Overview&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Register your application in Entra ID.&lt;/li&gt;
&lt;li&gt;Give access to the application to the users in the tenant.&lt;/li&gt;
&lt;li&gt;Create credentials for the application.&lt;/li&gt;
&lt;li&gt;Configure the application in Keycloak.&lt;/li&gt;
&lt;li&gt;Configure Grafana to use Keycloak.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;register-your-application-in-entra-id&#34;&gt;Register your application in Entra ID&lt;/h4&gt;
&lt;p&gt;Registering an application in Entra ID is a one-time process. You can follow the steps in the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Entra ID documentation&lt;/a&gt; to register your application.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the Azure portal and ensure you are using the correct tenant also known as directory.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;App Registrations&lt;/strong&gt; and click on &lt;strong&gt;New registration&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Fill in the details for the application and click &lt;strong&gt;Register&lt;/strong&gt;. You&amp;rsquo;ll be redirected to the application&amp;rsquo;s overview page.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;give-access-to-the-application-to-the-users-in-the-tenant&#34;&gt;Give access to the application to the users in the tenant&lt;/h4&gt;
&lt;p&gt;Assigning the correct access to users ensures only intended users or groups have access to the application.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Search for &lt;strong&gt;Enterprise Applications&lt;/strong&gt; and look for the application you just created in the previous step.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Manage&lt;/strong&gt; section, click on &lt;strong&gt;Users and groups&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Add user/group&lt;/strong&gt; and add the users or groups that should have access to the application.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;create-credentials-for-the-application&#34;&gt;Create credentials for the application&lt;/h4&gt;
&lt;p&gt;To authenticate with Entra ID, the Keycloak application needs a client ID and client secret.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Search for &lt;strong&gt;App Registrations&lt;/strong&gt; and look for the application ypu just created.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Certificates &amp;amp; Secrets&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;New client secret&lt;/strong&gt; and fill in the details. Make sure to copy the secret value as it will not be shown again.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;configure-the-application-in-keycloak&#34;&gt;Configure the application in Keycloak&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Go to the Keycloak admin console.&lt;/li&gt;
&lt;li&gt;Go to the Realm where you want to configure the Entra ID tenant.&lt;/li&gt;
&lt;li&gt;Go to the Identity Providers section and click on &lt;strong&gt;Add provider&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;OpenID Connect v1.0&lt;/strong&gt;.
&lt;ol&gt;
&lt;li&gt;Select a unique &lt;strong&gt;Alias&lt;/strong&gt; and &lt;strong&gt;Display name&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;Redirect URI&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Back in Azure Portal, go to the application&amp;rsquo;s &lt;strong&gt;Authentication&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;new platform&lt;/strong&gt; and select &lt;strong&gt;Web&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste the &lt;strong&gt;Redirect URI&lt;/strong&gt; from Keycloak.&lt;/li&gt;
&lt;li&gt;Save the changes.&lt;/li&gt;
&lt;li&gt;Navigate to the Azure Application overview and look for the &lt;strong&gt;Endpoints&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;OpenID Connect metadata document&lt;/strong&gt; URL.&lt;/li&gt;
&lt;li&gt;Head back to Keycloak and paste the URL in the &lt;strong&gt;Discovery endpoint&lt;/strong&gt; field.&lt;/li&gt;
&lt;li&gt;Navigate to the Azure application overview and look for the &lt;strong&gt;Application (client) ID&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;Application ID&lt;/strong&gt; and paste it in the &lt;strong&gt;Client ID&lt;/strong&gt; field in Keycloak.&lt;/li&gt;
&lt;li&gt;Paste the client secret you created in the previous step in the &lt;strong&gt;Client secret&lt;/strong&gt; field.&lt;/li&gt;
&lt;li&gt;Click Add.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&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;Up to this point, you have created an App Registration in Entra ID, assigned users to the application, created credentials for the application, and configured the application in Keycloak. In the Keycloak Client&amp;rsquo;s section, the client with ID &lt;code&gt;account&lt;/code&gt; Home URL can be used to test the configuration. This will open a new tab where you can login into the correct Keycloak realm with the Entra ID tenant you just configured.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Repeat this steps, for every Entra ID tenant you want to configure in Keycloak.&lt;/p&gt;
&lt;h4 id=&#34;configure-grafana-to-use-keycloak&#34;&gt;Configure Grafana to use Keycloak&lt;/h4&gt;
&lt;p&gt;Now that the Entra ID tenants are configured in Keycloak, you can configure Grafana to use Keycloak as the authentication provider.&lt;/p&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;/docs/grafana/latest/auth/keycloak/&#34;&gt;Keycloak documentation&lt;/a&gt; to configure Grafana to use Keycloak as the authentication provider.&lt;/p&gt;
]]></content><description>&lt;h1 id="multiple-providers-with-keycloak-in-grafana">Multiple providers with Keycloak in Grafana&lt;/h1>
&lt;p>While Grafana offers a variety of authentication providers, you can only configure one provider of one type at a time. However, you can configure multiple providers of the same type with the help of Keycloak.&lt;/p></description></item><item><title>Configure Okta OIDC authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/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/okta/</guid><content><![CDATA[&lt;h1 id=&#34;configure-okta-oidc-authentication&#34;&gt;Configure Okta OIDC authentication&lt;/h1&gt;


&lt;div data-shared=&#34;auth/intro.md&#34;&gt;
            &lt;p&gt;There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p&gt;
&lt;p&gt;When deciding on an authentication method, it&amp;rsquo;s important to take into account your current identity and access management system as well as the specific authentication and authorization features you require.
For a complete list of the available authentication options and the features they support, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/&#34;&gt;Configure authentication&lt;/a&gt;.&lt;/p&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;If Users use the same email address in Okta that they use with other authentication providers (such as Grafana.com), you need to do additional configuration to ensure that the users are matched correctly. Please refer to the &lt;a href=&#34;../#using-the-same-email-address-to-login-with-different-identity-providers&#34;&gt;Using the same email address to login with different identity providers&lt;/a&gt; documentation for more information.&lt;/p&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;To follow this guide, ensure you have permissions in your Okta workspace to create an OIDC app.&lt;/p&gt;
&lt;h2 id=&#34;create-an-okta-app&#34;&gt;Create an Okta app&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the Okta Admin Console, select &lt;strong&gt;Create App Integration&lt;/strong&gt; from the &lt;strong&gt;Applications&lt;/strong&gt; menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For &lt;strong&gt;Sign-in method&lt;/strong&gt;, select &lt;strong&gt;OIDC - OpenID Connect&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For &lt;strong&gt;Application type&lt;/strong&gt;, select &lt;strong&gt;Web Application&lt;/strong&gt; and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;strong&gt;New Web App Integration Operations&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;App integration name&lt;/strong&gt;: Choose a name for the app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logo (optional)&lt;/strong&gt;: Add a logo.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grant type&lt;/strong&gt;: Select &lt;strong&gt;Authorization Code&lt;/strong&gt; and &lt;strong&gt;Refresh Token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sign-in redirect URIs&lt;/strong&gt;: Replace the default setting with the Grafana Cloud Okta path, replacing &amp;lt;YOUR_ORG&amp;gt; with the name of your Grafana organization: https://&amp;lt;YOUR_ORG&amp;gt;.grafana.net/login/okta. For on-premises installation, use the Grafana server URL: http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/login/okta.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sign-out redirect URIs (optional)&lt;/strong&gt;: Replace the default setting with the Grafana Cloud Okta path, replacing &amp;lt;YOUR_ORG&amp;gt; with the name of your Grafana organization: https://&amp;lt;YOUR_ORG&amp;gt;.grafana.net/logout. For on-premises installation, use the Grafana server URL: http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/logout.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Base URIs (optional)&lt;/strong&gt;: Add any base URIs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Controlled access&lt;/strong&gt;: Select whether to assign the app integration to everyone in your organization, or only selected groups. You can assign this option after you create the app.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make a note of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ClientID&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client Secret&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auth URL&lt;/strong&gt;
For example: https://&amp;lt;TENANT_ID&amp;gt;.okta.com/oauth2/v1/authorize&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Token URL&lt;/strong&gt;
For example: https://&amp;lt;TENANT_ID&amp;gt;.okta.com/oauth2/v1/token&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API URL&lt;/strong&gt;
For example: https://&amp;lt;TENANT_ID&amp;gt;.okta.com/oauth2/v1/userinfo&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-okta-to-grafana-role-mapping&#34;&gt;Configure Okta to Grafana role mapping&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Okta Admin Console&lt;/strong&gt;, select &lt;strong&gt;Directory &amp;gt; Profile Editor&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the Okta Application Profile you created previously (the default name for this is &lt;code&gt;&amp;lt;App name&amp;gt; User&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Add Attribute&lt;/strong&gt; and fill in the following fields:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data Type&lt;/strong&gt;: string&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Display Name&lt;/strong&gt;: Meaningful name. For example, &lt;code&gt;Grafana Role&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variable Name&lt;/strong&gt;: Meaningful name. For example, &lt;code&gt;grafana_role&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Description (optional)&lt;/strong&gt;: A description of the role.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enum&lt;/strong&gt;: Select &lt;strong&gt;Define enumerated list of values&lt;/strong&gt; and add the following:
&lt;ul&gt;
&lt;li&gt;Display Name: Admin Value: Admin&lt;/li&gt;
&lt;li&gt;Display Name: Editor Value: Editor&lt;/li&gt;
&lt;li&gt;Display Name: Viewer Value: Viewer&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The remaining attributes are optional and can be set as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) You can add the role attribute to the default User profile. To do this, please follow the steps in the &lt;a href=&#34;#optional-add-the-role-attribute-to-the-user-default-okta-profile&#34;&gt;Optional: Add the role attribute to the User (default) Okta profile&lt;/a&gt; section.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-groups-claim&#34;&gt;Configure Groups claim&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;Okta Admin Console&lt;/strong&gt;, select &lt;strong&gt;Application &amp;gt; Applications&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the OpenID Connect application you created.&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Sign On&lt;/strong&gt; tab and click &lt;strong&gt;Edit&lt;/strong&gt; in the &lt;strong&gt;OpenID Connect ID Token&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Group claim type&lt;/strong&gt; section, select &lt;strong&gt;Filter&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Group claim filter&lt;/strong&gt; section, leave the default name &lt;code&gt;groups&lt;/code&gt; (or add it if the box is empty), then select &lt;strong&gt;Matches regex&lt;/strong&gt; and add the following regex: &lt;code&gt;.*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Back to applications&lt;/strong&gt; link at the top of the page.&lt;/li&gt;
&lt;li&gt;From the &lt;strong&gt;More&lt;/strong&gt; button dropdown menu, click &lt;strong&gt;Refresh Application Data&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Include the &lt;code&gt;groups&lt;/code&gt; scope in the &lt;strong&gt;Scopes&lt;/strong&gt; field in Grafana of the Okta integration.
For Terraform or in the Grafana configuration file, include the &lt;code&gt;groups&lt;/code&gt; scope in &lt;code&gt;scopes&lt;/code&gt; field.&lt;/li&gt;
&lt;/ol&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 configure the &lt;code&gt;groups&lt;/code&gt; claim differently, ensure that the &lt;code&gt;groups&lt;/code&gt; claim is a string array.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h4 id=&#34;optional-add-the-role-attribute-to-the-user-default-okta-profile&#34;&gt;Optional: Add the role attribute to the User (default) Okta profile&lt;/h4&gt;
&lt;p&gt;If you want to configure the role for all users in the Okta directory, you can add the role attribute to the User (default) Okta profile.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Return to the &lt;strong&gt;Directory&lt;/strong&gt; section and select &lt;strong&gt;Profile Editor&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the User (default) Okta profile, and click &lt;strong&gt;Add Attribute&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set all of the attributes in the same way you did in &lt;strong&gt;Step 3&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Add Mapping&lt;/strong&gt; to add your new attributes.
For example, &lt;strong&gt;user.grafana_role -&amp;gt; grafana_role&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;To add a role to a user, select the user from the &lt;strong&gt;Directory&lt;/strong&gt;, and click &lt;strong&gt;Profile -&amp;gt; Edit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select an option from your new attribute and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Update the Okta integration by setting the &lt;code&gt;Role attribute path&lt;/code&gt; (&lt;code&gt;role_attribute_path&lt;/code&gt; in Terraform and config file) to &lt;code&gt;&amp;lt;YOUR_ROLE_VARIABLE&amp;gt;&lt;/code&gt;. For example: &lt;code&gt;role_attribute_path = grafana_role&lt;/code&gt; (using the configuration).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-okta-authentication-client-using-the-grafana-ui&#34;&gt;Configure Okta authentication client using the Grafana UI&lt;/h2&gt;
&lt;p&gt;As a Grafana Admin, you can configure Okta OAuth2 client from within Grafana using the Okta UI. To do this, navigate to &lt;strong&gt;Administration &amp;gt; Authentication &amp;gt; Okta&lt;/strong&gt; page and fill in the form. If you have a current configuration in the Grafana configuration file then the form will be pre-populated with those values otherwise the form will contain default values.&lt;/p&gt;
&lt;p&gt;After you have filled in the form, click &lt;strong&gt;Save&lt;/strong&gt;. If the save was successful, Grafana will apply the new configurations.&lt;/p&gt;
&lt;p&gt;If you need to reset changes you made in the UI back to the default values, click &lt;strong&gt;Reset&lt;/strong&gt;. After you have reset the changes, Grafana will apply the configuration from the Grafana configuration file (if there is any configuration) or the default values.&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;If you run Grafana in high availability mode, configuration changes may not get applied to all Grafana instances immediately. You may need to wait a few minutes for the configuration to propagate to all Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;h2 id=&#34;configure-okta-authentication-client-using-the-terraform-provider&#34;&gt;Configure Okta authentication client using the Terraform provider&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;okta_sso_settings&amp;#34; {
  provider_name = &amp;#34;okta&amp;#34;
  oauth2_settings {
    name                  = &amp;#34;Okta&amp;#34;
    auth_url              = &amp;#34;https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/authorize&amp;#34;
    token_url             = &amp;#34;https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/token&amp;#34;
    api_url               = &amp;#34;https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/userinfo&amp;#34;
    client_id             = &amp;#34;CLIENT_ID&amp;#34;
    client_secret         = &amp;#34;CLIENT_SECRET&amp;#34;
    allow_sign_up         = true
    auto_login            = false
    scopes                = &amp;#34;openid profile email offline_access&amp;#34;
    role_attribute_path   = &amp;#34;contains(groups[*], &amp;#39;Example::DevOps&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || &amp;#39;None&amp;#39;&amp;#34;
    role_attribute_strict = true
    allowed_groups        = &amp;#34;Example::DevOps,Example::Dev,Example::QA&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/latest/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;
&lt;h2 id=&#34;configure-okta-authentication-client-using-the-grafana-configuration-file&#34;&gt;Configure Okta authentication client using the Grafana configuration file&lt;/h2&gt;
&lt;p&gt;Ensure that you have access to the &lt;a href=&#34;../../../configure-grafana/#configuration-file-location&#34;&gt;Grafana configuration file&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;p&gt;To integrate your Okta OIDC provider with Grafana using our Okta OIDC integration, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Follow the &lt;a href=&#34;#create-an-okta-app&#34;&gt;Create an Okta app&lt;/a&gt; steps to create an OIDC app in Okta.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the following table to update field values located in the &lt;code&gt;[auth.okta]&lt;/code&gt; section of the Grafana configuration file:&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;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;client_id&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;These values must match the client ID from your Okta OIDC app.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The authorization endpoint of your OIDC provider. &lt;code&gt;https://&amp;lt;okta-tenant-id&amp;gt;.okta.com/oauth2/v1/authorize&lt;/code&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;The token endpoint of your Okta OIDC provider. &lt;code&gt;https://&amp;lt;okta-tenant-id&amp;gt;.okta.com/oauth2/v1/token&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The user information endpoint of your Okta OIDC provider. &lt;code&gt;https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/userinfo&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enables Okta OIDC authentication. Set this value to &lt;code&gt;true&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;Review the list of other Okta OIDC &lt;a href=&#34;#configuration-options&#34;&gt;configuration options&lt;/a&gt; and complete them as necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;a href=&#34;#configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;a href=&#34;#configure-team-synchronization-enterprise-only&#34;&gt;Configure team synchronization&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart Grafana.&lt;/p&gt;
&lt;p&gt;You should now see a Okta OIDC login button on the login page and be able to log in or sign up with your OIDC provider.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following is an example of a minimally functioning integration when
configured with the instructions above:&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.okta]
name = Okta
icon = okta
enabled = true
allow_sign_up = true
client_id = &amp;lt;client id&amp;gt;
scopes = openid profile email offline_access
auth_url = https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/authorize
token_url = https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/token
api_url = https://&amp;lt;okta tenant id&amp;gt;.okta.com/oauth2/v1/userinfo
role_attribute_path = grafana_role
role_attribute_strict = true
allowed_groups = &amp;#34;Example::DevOps&amp;#34; &amp;#34;Example::Dev&amp;#34; &amp;#34;Example::QA&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-a-refresh-token&#34;&gt;Configure a refresh token&lt;/h3&gt;
&lt;p&gt;When a user logs in using an OAuth provider, Grafana verifies that the access token has not expired. When an access token expires, Grafana uses the provided refresh token (if any exists) to obtain a new access token without requiring the user to log in again.&lt;/p&gt;
&lt;p&gt;If a refresh token doesn&amp;rsquo;t exist, Grafana logs the user out of the system after the access token has expired.&lt;/p&gt;
&lt;p&gt;To enable the &lt;code&gt;Refresh Token&lt;/code&gt; head over the Okta application settings and:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Under &lt;code&gt;General&lt;/code&gt; tab, find the &lt;code&gt;General Settings&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;Within the &lt;code&gt;Grant Type&lt;/code&gt; options, enable the &lt;code&gt;Refresh Token&lt;/code&gt; checkbox.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At the configuration file, extend the &lt;code&gt;scopes&lt;/code&gt; in &lt;code&gt;[auth.okta]&lt;/code&gt; section with &lt;code&gt;offline_access&lt;/code&gt; and set &lt;code&gt;use_refresh_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configure-jwt-id-token-validation&#34;&gt;Configure JWT ID token validation&lt;/h3&gt;
&lt;p&gt;By default, Grafana extracts user information from ID tokens without validating their cryptographic signatures. To enhance security, you can enable JWT signature validation to ensure that ID tokens are authentic and have not been tampered with.&lt;/p&gt;
&lt;p&gt;To enable JWT ID token validation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set &lt;code&gt;validate_id_token&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the &lt;code&gt;[auth.okta]&lt;/code&gt; section of the Grafana configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;code&gt;jwk_set_url&lt;/code&gt; with the URL of your Okta tenant&amp;rsquo;s JSON Web Key Set (JWKS) endpoint. This endpoint provides the public keys used to verify JWT signatures.&lt;/p&gt;
&lt;p&gt;For Okta, the JWKS endpoint is: &lt;code&gt;https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/keys&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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.okta]
enabled = true
validate_id_token = true
jwk_set_url = https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/keys
client_id = &amp;lt;client id&amp;gt;
client_secret = &amp;lt;client secret&amp;gt;
scopes = openid profile email groups&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;When JWT validation is enabled, Grafana caches the JWKS keys to improve performance. The cache respects the &lt;code&gt;Cache-Control&lt;/code&gt; header from the JWKS endpoint response. If no cache expiration is specified, keys are cached for 5 minutes by default.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;If &lt;code&gt;validate_id_token&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt;, you must configure &lt;code&gt;jwk_set_url&lt;/code&gt;. Authentication will fail if the JWK Set URL is not provided or if the ID token signature cannot be verified.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h3&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;Unless &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role retrieved from the auth provider upon user login.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option against the &lt;code&gt;api_url&lt;/code&gt; (&lt;code&gt;/userinfo&lt;/code&gt; OIDC endpoint) endpoint payload.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_attribute_path&lt;/code&gt; and &lt;code&gt;org_mapping&lt;/code&gt; configuration options to assign the user to organizations and specify their role. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If both org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) and the regular role mapping (&lt;code&gt;role_attribute_path&lt;/code&gt;) are specified, then the user will get the highest of the two mapped roles.&lt;/p&gt;
&lt;p&gt;To allow mapping Grafana server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.
Refer to &lt;a href=&#34;../generic-oauth/#configuration-options&#34;&gt;configuration options&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&#34;#create-an-okta-app&#34;&gt;Create an Okta app&lt;/a&gt;, you created a custom attribute in Okta to store the role. You can use this attribute to map the role to a Grafana role by setting the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option to the custom attribute name: &lt;code&gt;role_attribute_path = grafana_role&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you want to map the role based on the user&amp;rsquo;s group, you can use the &lt;code&gt;groups&lt;/code&gt; attribute from the user info endpoint. An example of this is &lt;code&gt;role_attribute_path = contains(groups[*], &#39;Example::DevOps&#39;) &amp;amp;&amp;amp; &#39;Admin&#39; || &#39;None&#39;&lt;/code&gt;. You can find more examples of JMESPath expressions on the Generic OAuth page for &lt;a href=&#34;../generic-oauth/#role-mapping-examples&#34;&gt;JMESPath examples&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To learn about adding custom claims to the user info in Okta, refer to &lt;a href=&#34;https://developer.okta.com/docs/guides/customize-tokens-returned-from-okta/main/#add-a-custom-claim-to-a-token&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;add custom claims&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/h4&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 self-managed Grafana installations.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;In this example, the &lt;code&gt;org_mapping&lt;/code&gt; uses the &lt;code&gt;groups&lt;/code&gt; attribute as the source (&lt;code&gt;org_attribute_path&lt;/code&gt;) to map the current user to different organizations and roles. The user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; org if they are a member of the &lt;code&gt;Group 1&lt;/code&gt; group, the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; org if they are a member of the &lt;code&gt;Group 2&lt;/code&gt; group, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_baz&lt;/code&gt;(OrgID=3) org.&lt;/p&gt;
&lt;p&gt;Config:&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_attribute_path = groups
org_mapping = [&amp;#34;Group 1:org_foo:Viewer&amp;#34;, &amp;#34;Group 2:org_bar:Editor&amp;#34;, &amp;#34;*:3:Editor&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-team-synchronization&#34;&gt;Configure team synchronization&lt;/h3&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;/products/cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;By using Team Sync, you can link your Okta groups to teams within Grafana. This will automatically assign users to the appropriate teams.&lt;/p&gt;
&lt;p&gt;Map your Okta groups to teams in Grafana so that your users will automatically be added to
the correct teams.&lt;/p&gt;
&lt;p&gt;Okta groups can be referenced by group names, like &lt;code&gt;Admins&lt;/code&gt; or &lt;code&gt;Editors&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To learn more about Team Sync, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-access/configure-team-sync/&#34;&gt;Configure Team Sync&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table outlines the various Okta OIDC configuration options. You can apply these options as environment variables, similar to any other configuration within Grafana. For more information, refer to &lt;a href=&#34;../../../configure-grafana/#override-configuration-with-environment-variables&#34;&gt;Override configuration with environment variables&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;If the configuration option requires a JMESPath expression that includes a colon, enclose the entire expression in quotes to prevent parsing errors. For example &lt;code&gt;role_attribute_path: &amp;quot;role:view&amp;quot;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;Supported on Cloud&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;Yes&lt;/td&gt;
              &lt;td&gt;Enables Okta OIDC authentication.&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;Yes&lt;/td&gt;
              &lt;td&gt;Name that refers to the Okta OIDC authentication from the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Okta&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;icon&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Icon used for the Okta OIDC authentication in the Grafana user interface.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;okta&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client ID provided by your Okta OIDC app.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Client secret provided by your Okta OIDC app.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Authorization endpoint of your Okta OIDC provider.&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;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain the Okta OIDC access token.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;api_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Endpoint used to obtain user information.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;scopes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated Okta OIDC scopes.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;openid profile email groups&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;Yes&lt;/td&gt;
              &lt;td&gt;Controls Grafana user creation through the Okta OIDC login. Only existing Grafana users can log in with Okta OIDC if set to &lt;code&gt;false&lt;/code&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to enable users to bypass the login screen and automatically log in. This setting is ignored if you configure multiple auth providers to use auto-login.&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;role_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana role lookup. Grafana will first evaluate the expression using the Okta OIDC ID token. If no role is found, the expression will be evaluated using the user information obtained from the UserInfo endpoint. The result of the evaluation should be a valid Grafana role (&lt;code&gt;None&lt;/code&gt;, &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt;, &lt;code&gt;Admin&lt;/code&gt; or &lt;code&gt;GrafanaAdmin&lt;/code&gt;). For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role_attribute_strict&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to deny user login if the Grafana org role cannot be extracted using &lt;code&gt;role_attribute_path&lt;/code&gt; or &lt;code&gt;org_mapping&lt;/code&gt;. For more information on user role mapping, refer to &lt;a href=&#34;#configure-role-mapping&#34;&gt;Configure role mapping&lt;/a&gt;.&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;org_attribute_path&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression to use for Grafana org to role lookup. The result of the evaluation will be mapped to org roles based on &lt;code&gt;org_mapping&lt;/code&gt;. For more information on org to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;No&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated &lt;code&gt;&amp;lt;ExternalOrgName&amp;gt;:&amp;lt;OrgIdOrName&amp;gt;:&amp;lt;Role&amp;gt;&lt;/code&gt; mappings. Value 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;. For more information on external organization to role mapping, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;.&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;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to stop automatically syncing user roles. This will allow you to set organization roles for your users from within Grafana manually.&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;allowed_groups&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated groups. The user should be a member of at least one group to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;allowed_domains&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;List of comma- or space-separated domains. The user should belong to at least one domain to log in.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;use_pkce&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7636&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Proof Key for Code Exchange (PKCE)&lt;/a&gt;. Grafana uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&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;use_refresh_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Set to &lt;code&gt;true&lt;/code&gt; to use refresh token and check access token expiration.&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;validate_id_token&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;If enabled, Grafana will validate the JWT signature of ID tokens using the JWKS endpoint. This enhances security by ensuring tokens are authentic and have not been tampered with.&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;jwk_set_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL of the JSON Web Key Set (JWKS) endpoint used to verify JWT ID token signatures. Required when ID token validation is enabled. For Okta, use &lt;code&gt;https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/keys&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;signout_redirect_url&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;URL to redirect to after the user logs out.&lt;/td&gt;
              &lt;td&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-okta-oidc-authentication">Configure Okta OIDC authentication&lt;/h1>
&lt;div data-shared="auth/intro.md">
&lt;p>There are numerous authentication methods available in Grafana to verify user identity. The authentication configuration dictates which users can access Grafana and the methods they can use for logging in.
You can also configure Grafana to automatically update users&amp;rsquo; roles and team memberships in Grafana based on the information returned by the auth provider integration.&lt;/p></description></item><item><title>Configure auth proxy authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/auth-proxy/</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/auth-proxy/</guid><content><![CDATA[&lt;h1 id=&#34;configure-auth-proxy-authentication&#34;&gt;Configure auth proxy authentication&lt;/h1&gt;
&lt;p&gt;You can configure Grafana to let a HTTP reverse proxy handle authentication. Popular web servers have a very
extensive list of pluggable authentication modules, and any of them can be used with the AuthProxy feature.
Below we detail the configuration options for auth proxy.&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;[auth.proxy]
# Defaults to false, but set to true to enable this feature
enabled = true
# HTTP Header name that will contain the username or email
header_name = X-WEBAUTH-USER
# HTTP Header property, defaults to `username` but can also be `email`
header_property = username
# Set to `true` to enable auto sign up of users who do not exist in Grafana DB. Defaults to `true`.
auto_sign_up = true
# Define cache time to live in minutes
# If combined with Grafana LDAP integration it is also the sync interval
# Set to 0 to always fetch and sync the latest user data
sync_ttl = 15
# Limit where auth proxy requests come from by configuring a list of IP addresses.
# This can be used to prevent users spoofing the X-WEBAUTH-USER header.
# Example `whitelist = 192.168.1.1, 192.168.1.0/24, 2001::23, 2001::0/120`
whitelist =
# Optionally define more headers to sync other user attributes
# Example `headers = Name:X-WEBAUTH-NAME Role:X-WEBAUTH-ROLE Email:X-WEBAUTH-EMAIL Groups:X-WEBAUTH-GROUPS`
headers =
# Non-ASCII strings in header values are encoded using quoted-printable encoding
;headers_encoded = false
# Check out docs on this for more details on the below setting
enable_login_token = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;interacting-with-grafanas-authproxy-via-curl&#34;&gt;Interacting with Grafana’s AuthProxy via curl&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;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 -H &amp;#34;X-WEBAUTH-USER: admin&amp;#34;  http://localhost:3000/api/users
[
    {
        &amp;#34;id&amp;#34;:1,
        &amp;#34;name&amp;#34;:&amp;#34;&amp;#34;,
        &amp;#34;login&amp;#34;:&amp;#34;admin&amp;#34;,
        &amp;#34;email&amp;#34;:&amp;#34;admin@localhost&amp;#34;,
        &amp;#34;isAdmin&amp;#34;:true
    }
]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We can then send a second request to the &lt;code&gt;/api/user&lt;/code&gt; method which will return the details of the logged in user. We will use this request to show how Grafana automatically adds the new user we specify to the system. Here we create a new user called “anthony”.&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 -H &amp;#34;X-WEBAUTH-USER: anthony&amp;#34; http://localhost:3000/api/user
{
    &amp;#34;email&amp;#34;:&amp;#34;anthony&amp;#34;,
    &amp;#34;name&amp;#34;:&amp;#34;&amp;#34;,
    &amp;#34;login&amp;#34;:&amp;#34;anthony&amp;#34;,
    &amp;#34;theme&amp;#34;:&amp;#34;&amp;#34;,
    &amp;#34;orgId&amp;#34;:1,
    &amp;#34;isGrafanaAdmin&amp;#34;:false
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;making-apaches-auth-work-together-with-grafanas-authproxy&#34;&gt;Making Apache’s auth work together with Grafana’s AuthProxy&lt;/h2&gt;
&lt;p&gt;I’ll demonstrate how to use Apache for authenticating users. In this example we use BasicAuth with Apache’s text file based authentication handler, i.e. htpasswd files. However, any available Apache authentication capabilities could be used.&lt;/p&gt;
&lt;h3 id=&#34;apache-basicauth&#34;&gt;Apache BasicAuth&lt;/h3&gt;
&lt;p&gt;In this example we use Apache as a reverse proxy in front of Grafana. Apache handles the Authentication of users before forwarding requests to the Grafana backend service.&lt;/p&gt;
&lt;h4 id=&#34;apache-configuration&#34;&gt;Apache configuration&lt;/h4&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;    &amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@authproxy
        ServerName authproxy
        ErrorLog &amp;#34;logs/authproxy-error_log&amp;#34;
        CustomLog &amp;#34;logs/authproxy-access_log&amp;#34; common

        &amp;lt;Proxy *&amp;gt;
            AuthType Basic
            AuthName GrafanaAuthProxy
            AuthBasicProvider file
            AuthUserFile /etc/apache2/grafana_htpasswd
            Require valid-user

            RewriteEngine On
            RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
            RequestHeader set X-WEBAUTH-USER &amp;#34;%{PROXY_USER}e&amp;#34;
        &amp;lt;/Proxy&amp;gt;

        RequestHeader unset Authorization

        ProxyRequests Off
        ProxyPass / http://localhost:3000/
        ProxyPassReverse / http://localhost:3000/
    &amp;lt;/VirtualHost&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The first four lines of the virtualhost configuration are standard, so we won’t go into detail on what they do.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We use a &lt;strong&gt;&amp;lt;proxy&amp;gt;&lt;/strong&gt; configuration block for applying our authentication rules to every proxied request. These rules include requiring basic authentication where user:password credentials are stored in the &lt;strong&gt;/etc/apache2/grafana_htpasswd&lt;/strong&gt; file. This file can be created with the &lt;code&gt;htpasswd&lt;/code&gt; command.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The next part of the configuration is the tricky part. We use Apache’s rewrite engine to create our &lt;strong&gt;X-WEBAUTH-USER header&lt;/strong&gt;, populated with the authenticated user.
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}, NS]&lt;/strong&gt;: This line is a little bit of magic. What it does, is for every request use the rewriteEngines look-ahead (LA-U) feature to determine what the REMOTE_USER variable would be set to after processing the request. Then assign the result to the variable PROXY_USER. This is necessary as the REMOTE_USER variable is not available to the RequestHeader function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;RequestHeader set X-WEBAUTH-USER “%{PROXY_USER}e”&lt;/strong&gt;: With the authenticated username now stored in the PROXY_USER variable, we create a new HTTP request header that will be sent to our backend Grafana containing the username.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;strong&gt;RequestHeader unset Authorization&lt;/strong&gt; removes the Authorization header from the HTTP request before it is forwarded to Grafana. This ensures that Grafana does not try to authenticate the user using these credentials (BasicAuth is a supported authentication handler in Grafana).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The last 3 lines are then just standard reverse proxy configuration to direct all authenticated requests to our Grafana server running on port 3000.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;full-walkthrough-using-docker&#34;&gt;Full walkthrough using Docker.&lt;/h2&gt;
&lt;p&gt;For this example, we use the official Grafana Docker image available at &lt;a href=&#34;https://hub.docker.com/r/grafana/grafana/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker Hub&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a file &lt;code&gt;grafana.ini&lt;/code&gt; with the following contents&lt;/li&gt;
&lt;/ul&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;[users]
allow_sign_up = false
auto_assign_org = true
auto_assign_org_role = Editor

[auth.proxy]
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Launch the Grafana container, using our custom &lt;code&gt;grafana.ini&lt;/code&gt; to replace &lt;code&gt;/etc/grafana/grafana.ini&lt;/code&gt;. We don&amp;rsquo;t expose
any ports for this container as it will only be connected to by our Apache container.&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;docker run -i -v $(pwd)/grafana.ini:/etc/grafana/grafana.ini --name grafana grafana/grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;apache-container&#34;&gt;Apache Container&lt;/h3&gt;
&lt;p&gt;For this example we use the official Apache docker image available at &lt;a href=&#34;https://hub.docker.com/_/httpd/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker Hub&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a file named &lt;code&gt;httpd.conf&lt;/code&gt; with the following contents&lt;/li&gt;
&lt;/ul&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;ServerRoot &amp;#34;/usr/local/apache2&amp;#34;
Listen 80
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
&amp;lt;IfModule unixd_module&amp;gt;
User daemon
Group daemon
&amp;lt;/IfModule&amp;gt;
ServerAdmin you@example.com
&amp;lt;Directory /&amp;gt;
    AllowOverride none
    Require all denied
&amp;lt;/Directory&amp;gt;
DocumentRoot &amp;#34;/usr/local/apache2/htdocs&amp;#34;
ErrorLog /proc/self/fd/2
LogLevel error
&amp;lt;IfModule log_config_module&amp;gt;
    LogFormat &amp;#34;%h %l %u %t \&amp;#34;%r\&amp;#34; %&amp;gt;s %b \&amp;#34;%{Referer}i\&amp;#34; \&amp;#34;%{User-Agent}i\&amp;#34;&amp;#34; combined
    LogFormat &amp;#34;%h %l %u %t \&amp;#34;%r\&amp;#34; %&amp;gt;s %b&amp;#34; common
    &amp;lt;IfModule logio_module&amp;gt;
    LogFormat &amp;#34;%h %l %u %t \&amp;#34;%r\&amp;#34; %&amp;gt;s %b \&amp;#34;%{Referer}i\&amp;#34; \&amp;#34;%{User-Agent}i\&amp;#34; %I %O&amp;#34; combinedio
    &amp;lt;/IfModule&amp;gt;
    CustomLog /proc/self/fd/1 common
&amp;lt;/IfModule&amp;gt;
&amp;lt;Proxy *&amp;gt;
    AuthType Basic
    AuthName GrafanaAuthProxy
    AuthBasicProvider file
    AuthUserFile /tmp/htpasswd
    Require valid-user
    RewriteEngine On
    RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER},NS]
    RequestHeader set X-WEBAUTH-USER &amp;#34;%{PROXY_USER}e&amp;#34;
&amp;lt;/Proxy&amp;gt;
RequestHeader unset Authorization
ProxyRequests Off
ProxyPass / http://grafana:3000/
ProxyPassReverse / http://grafana:3000/&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;htpasswd&lt;/code&gt; file. We create a new user &lt;strong&gt;anthony&lt;/strong&gt; with the password &lt;strong&gt;password&lt;/strong&gt;&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;htpasswd -bc htpasswd anthony password&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Launch the Apache HTTP server container using our custom &lt;code&gt;httpd.conf&lt;/code&gt; and our &lt;code&gt;htpasswd&lt;/code&gt; file. The container will listen on port 80, and we create a link to the &lt;strong&gt;grafana&lt;/strong&gt; container so that this container can resolve the hostname &lt;strong&gt;grafana&lt;/strong&gt; to the Grafana container’s IP address.&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;docker run -i -p 80:80 --link grafana:grafana -v $(pwd)/httpd.conf:/usr/local/apache2/conf/httpd.conf -v $(pwd)/htpasswd:/tmp/htpasswd httpd:2.4&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;use-grafana&#34;&gt;Use grafana.&lt;/h3&gt;
&lt;p&gt;With our Grafana and Apache containers running, you can now connect to http://localhost/ and log in using the username and password we created in the &lt;code&gt;htpasswd&lt;/code&gt; file.&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;If the user is deleted from Grafana, the user will be not be able to login and resync until after the &lt;code&gt;sync_ttl&lt;/code&gt; has expired.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;team-sync&#34;&gt;Team Sync&lt;/h3&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;With Team Sync, it&amp;rsquo;s possible to set up synchronization between teams in your authentication provider and Grafana. You can send Grafana values as part of an HTTP header and have Grafana map them to your team structure. This allows you to put users into specific teams automatically.&lt;/p&gt;
&lt;p&gt;To support the feature, auth proxy allows optional headers to map additional user attributes. The specific attribute to support team sync is &lt;code&gt;Groups&lt;/code&gt;.&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;# Optionally define more headers to sync other user attributes
headers = &amp;#34;Groups:X-WEBAUTH-GROUPS&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You use the &lt;code&gt;X-WEBAUTH-GROUPS&lt;/code&gt; header to send the team information for each user. Specifically, the set of Grafana&amp;rsquo;s group IDs that the user belongs to.&lt;/p&gt;
&lt;p&gt;First, we need to set up the mapping between your authentication provider and Grafana. Follow &lt;a href=&#34;../../configure-team-sync/#synchronize-a-grafana-team-with-an-external-group&#34;&gt;these instructions&lt;/a&gt; to add groups to a team within Grafana.&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done. You can verify your mappings by querying the API.&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;# First, inspect your teams and obtain the corresponding ID of the team we want to inspect the groups for.
curl -H &amp;#34;X-WEBAUTH-USER: admin&amp;#34; -H &amp;#34;X-WEBAUTH-GROUPS: lokiteamOnExternalSystem&amp;#34; http://localhost:3000/api/teams/search
{
  &amp;#34;totalCount&amp;#34;: 2,
  &amp;#34;teams&amp;#34;: [
    {
      &amp;#34;id&amp;#34;: 1,
      &amp;#34;orgId&amp;#34;: 1,
      &amp;#34;name&amp;#34;: &amp;#34;Core&amp;#34;,
      &amp;#34;email&amp;#34;: &amp;#34;core@grafana.com&amp;#34;,
      &amp;#34;avatarUrl&amp;#34;: &amp;#34;/avatar/327a5353552d2dc3966e2e646908f540&amp;#34;,
      &amp;#34;memberCount&amp;#34;: 1,
      &amp;#34;permission&amp;#34;: 0
    },
    {
      &amp;#34;id&amp;#34;: 2,
      &amp;#34;orgId&amp;#34;: 1,
      &amp;#34;name&amp;#34;: &amp;#34;Loki&amp;#34;,
      &amp;#34;email&amp;#34;: &amp;#34;loki@grafana.com&amp;#34;,
      &amp;#34;avatarUrl&amp;#34;: &amp;#34;/avatar/102f937d5344d33fdb37b65d430f36ef&amp;#34;,
      &amp;#34;memberCount&amp;#34;: 0,
      &amp;#34;permission&amp;#34;: 0
    }
  ],
  &amp;#34;page&amp;#34;: 1,
  &amp;#34;perPage&amp;#34;: 1000
}

# Then, query the groups for that particular team. In our case, the Loki team which has an ID of &amp;#34;2&amp;#34;.
curl -H &amp;#34;X-WEBAUTH-USER: admin&amp;#34; -H &amp;#34;X-WEBAUTH-GROUPS: lokiteamOnExternalSystem&amp;#34; http://localhost:3000/api/teams/2/groups
[
  {
    &amp;#34;orgId&amp;#34;: 1,
    &amp;#34;teamId&amp;#34;: 2,
    &amp;#34;groupId&amp;#34;: &amp;#34;lokiTeamOnExternalSystem&amp;#34;
  }
]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, whenever Grafana receives a request with a header of &lt;code&gt;X-WEBAUTH-GROUPS: lokiTeamOnExternalSystem&lt;/code&gt;, the user under authentication will be placed into the specified team. Placement in multiple teams is supported by using comma-separated values e.g. &lt;code&gt;lokiTeamOnExternalSystem,CoreTeamOnExternalSystem&lt;/code&gt;.&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 -H &amp;#34;X-WEBAUTH-USER: leonard&amp;#34; -H &amp;#34;X-WEBAUTH-GROUPS: lokiteamOnExternalSystem&amp;#34; http://localhost:3000/dashboards/home
{
  &amp;#34;meta&amp;#34;: {
    &amp;#34;isHome&amp;#34;: true,
    &amp;#34;canSave&amp;#34;: false,
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With this, the user &lt;code&gt;leonard&lt;/code&gt; will be automatically placed into the Loki team as part of Grafana authentication.&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;An empty &lt;code&gt;X-WEBAUTH-GROUPS&lt;/code&gt; or the absence of a groups header will remove the user from all teams.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&#34;../../configure-team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;login-token-and-session-cookie&#34;&gt;Login token and session cookie&lt;/h2&gt;
&lt;p&gt;With &lt;code&gt;enable_login_token&lt;/code&gt; set to &lt;code&gt;true&lt;/code&gt; Grafana will, after successful auth proxy header validation, assign the user
a login token and cookie. You only have to configure your auth proxy to provide headers for the /login route.
Requests via other routes will be authenticated using the cookie.&lt;/p&gt;
&lt;p&gt;Use the settings &lt;code&gt;login_maximum_inactive_lifetime_duration&lt;/code&gt; and &lt;code&gt;login_maximum_lifetime_duration&lt;/code&gt; under &lt;code&gt;[auth]&lt;/code&gt; to control session
lifetime.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-auth-proxy-authentication">Configure auth proxy authentication&lt;/h1>
&lt;p>You can configure Grafana to let a HTTP reverse proxy handle authentication. Popular web servers have a very
extensive list of pluggable authentication modules, and any of them can be used with the AuthProxy feature.
Below we detail the configuration options for auth proxy.&lt;/p></description></item><item><title>Configure JWT authentication</title><link>https://grafana.com/docs/grafana/v12.4/setup-grafana/configure-access/configure-authentication/jwt/</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/jwt/</guid><content><![CDATA[&lt;h1 id=&#34;configure-jwt-authentication&#34;&gt;Configure JWT authentication&lt;/h1&gt;
&lt;p&gt;You can configure Grafana to accept a JWT token provided in the HTTP header. The token is verified using any of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PEM-encoded key file&lt;/li&gt;
&lt;li&gt;JSON Web Key Set (JWKS) in a local file&lt;/li&gt;
&lt;li&gt;JWKS provided by the configured JWKS endpoint&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This method of authentication is useful for integrating with other systems that
use JWKS but can&amp;rsquo;t directly integrate with Grafana or if you want to use pass-through
authentication in an app embedding Grafana.&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;Grafana does not currently support refresh tokens.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;enable-jwt&#34;&gt;Enable JWT&lt;/h2&gt;
&lt;p&gt;To use JWT authentication:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable JWT in the &lt;a href=&#34;../../../configure-grafana/&#34;&gt;main config file&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Specify the header name that contains a token.&lt;/li&gt;
&lt;/ol&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.jwt]
# By default, auth.jwt is disabled.
enabled = true

# HTTP header to look into to get a JWT token.
header_name = X-JWT-Assertion&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-login-claim&#34;&gt;Configure login claim&lt;/h2&gt;
&lt;p&gt;To identify the user, some of the claims needs to be selected as a login info. The subject claim called &lt;code&gt;&amp;quot;sub&amp;quot;&lt;/code&gt; is mandatory and needs to identify the principal that is the subject of the JWT.&lt;/p&gt;
&lt;p&gt;Typically, the subject claim called &lt;code&gt;&amp;quot;sub&amp;quot;&lt;/code&gt; would be used as a login but it might also be set to some application specific claim.&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.jwt]
# ...

# Specify a claim to use as a username to sign in.
username_claim = sub

# Specify a claim to use as an email to sign in.
email_claim = sub

# auto-create users if they are not already matched
# auto_sign_up = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If &lt;code&gt;auto_sign_up&lt;/code&gt; is enabled, then the &lt;code&gt;sub&lt;/code&gt; claim is used as the &amp;ldquo;external Auth ID&amp;rdquo;. The &lt;code&gt;name&lt;/code&gt; claim is used as the user&amp;rsquo;s full name if it is present.&lt;/p&gt;
&lt;p&gt;Additionally, if the login username or the email claims are nested inside the JWT structure, you can specify the path to the attributes using the &lt;code&gt;username_attribute_path&lt;/code&gt; and &lt;code&gt;email_attribute_path&lt;/code&gt; configuration options using the JMESPath syntax.&lt;/p&gt;
&lt;p&gt;JWT structure 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;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;user&amp;#34;: {
    &amp;#34;UID&amp;#34;: &amp;#34;1234567890&amp;#34;,
    &amp;#34;name&amp;#34;: &amp;#34;John Doe&amp;#34;,
    &amp;#34;username&amp;#34;: &amp;#34;johndoe&amp;#34;,
    &amp;#34;emails&amp;#34;: [&amp;#34;personal@email.com&amp;#34;, &amp;#34;professional@email.com&amp;#34;]
  }
}&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;# [auth.jwt]
# ...

# Specify a nested attribute to use as a username to sign in.
username_attribute_path = user.username # user&amp;#39;s login is johndoe

# Specify a nested attribute to use as an email to sign in.
email_attribute_path = user.emails[1] # user&amp;#39;s email is professional@email.com&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;iframe-embedding&#34;&gt;Iframe Embedding&lt;/h2&gt;
&lt;p&gt;If you want to embed Grafana in an iframe while maintaining user identity and role checks,
you can use JWT authentication to authenticate the iframe.&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, or scenarios where verifying viewer identity is not required,
embed 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/share-dashboards-panels/shared-dashboards/&#34;&gt;shared dashboards&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;In this scenario, you will need to configure Grafana to accept a JWT
provided in the HTTP header and a reverse proxy should rewrite requests to the
Grafana instance to include the JWT in the request&amp;rsquo;s headers.&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 embedding to work, you must enable &lt;code&gt;allow_embedding&lt;/code&gt; in the &lt;a href=&#34;../../../configure-grafana/#allow_embedding&#34;&gt;security section&lt;/a&gt;. This setting is not available in Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;In a scenario where it is not possible to rewrite the request headers you
can use URL login instead.&lt;/p&gt;
&lt;h3 id=&#34;url-login&#34;&gt;URL login&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;url_login&lt;/code&gt; allows grafana to search for a JWT in the URL query parameter
&lt;code&gt;auth_token&lt;/code&gt; and use it as the authentication token.&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;You need to enable JWT before setting this setting. Refer to &lt;a href=&#34;#enable-jwt&#34;&gt;Enabled JWT&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&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;This can lead to JWTs being exposed in logs and possible session hijacking if the server is not
using HTTP over TLS.&lt;/p&gt;&lt;/blockquote&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;# [auth.jwt]
# ...
url_login = true # enable JWT authentication in the URL&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;An example of an URL for accessing grafana with JWT URL authentication is:&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://env.grafana.local/d/RciOKLR4z/board-identifier?orgId=1&amp;amp;kiosk&amp;amp;auth_token=eyJhbxxxxxxxxxxxxx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A sample repository using this authentication method is available
at &lt;a href=&#34;https://github.com/grafana/grafana-iframe-oauth-sample&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;grafana-iframe-oauth-sample&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;signature-verification&#34;&gt;Signature verification&lt;/h2&gt;
&lt;p&gt;JSON web token integrity needs to be verified so cryptographic signature is used for this purpose. So we expect that every token must be signed with some known cryptographic key.&lt;/p&gt;
&lt;p&gt;You have a variety of options on how to specify where the keys are located.&lt;/p&gt;
&lt;h3 id=&#34;verify-token-using-a-json-web-key-set-loaded-from-https-endpoint&#34;&gt;Verify token using a JSON Web Key Set loaded from https endpoint&lt;/h3&gt;
&lt;p&gt;For more information on JWKS endpoints, refer to &lt;a href=&#34;https://auth0.com/docs/tokens/json-web-tokens/json-web-key-sets&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Auth0 docs&lt;/a&gt;.&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.jwt]
# ...

jwk_set_url = https://your-auth-provider.example.com/.well-known/jwks.json

# When the JWKS url requires an &amp;#39;Authorization: Bearer &amp;lt;TOKEN&amp;gt;&amp;#39; header
# jwk_set_bearer_token_file = /path/to/bearer_token

# Cache duration for https endpoint response.
cache_ttl = 60m

# Path to file containing one or more custom PEM-encoded CA certificates.
# Used with jwk_set_url when the JWKS endpoint uses a certificate that is not
# trusted by the default CA bundle (e.g. self-signed certificates).
# tls_client_ca = /path/to/ca.crt

# Skip CA Verification entirely
# tls_skip_verify_insecure = false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;If the JWKS endpoint includes cache control headers and the value is less than the configured &lt;code&gt;cache_ttl&lt;/code&gt;, then the cache control header value is used instead. If the &lt;code&gt;cache_ttl&lt;/code&gt; is not set, the default of &lt;code&gt;60m&lt;/code&gt; is used. &lt;code&gt;no-store&lt;/code&gt; and &lt;code&gt;no-cache&lt;/code&gt; cache control headers are ignored. To disable JWKS caching, set &lt;code&gt;cache_ttl = 0s&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;verify-token-using-a-json-web-key-set-loaded-from-json-file&#34;&gt;Verify token using a JSON Web Key Set loaded from JSON file&lt;/h3&gt;
&lt;p&gt;Key set in the same format as in JWKS endpoint but located on disk.&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;jwk_set_file = /path/to/jwks.json&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;verify-token-using-a-single-key-loaded-from-pem-encoded-file&#34;&gt;Verify token using a single key loaded from PEM-encoded file&lt;/h3&gt;
&lt;p&gt;PEM-encoded key file in PKIX, PKCS #1, PKCS #8 or SEC 1 format.&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;key_file = /path/to/key.pem&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If the JWT token&amp;rsquo;s header specifies a &lt;code&gt;kid&lt;/code&gt; (Key ID), then the Key ID must be set using the &lt;code&gt;key_id&lt;/code&gt; configuration 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;key_id = my-key-id&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;validate-claims&#34;&gt;Validate claims&lt;/h2&gt;
&lt;p&gt;By default, only &lt;code&gt;&amp;quot;exp&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;nbf&amp;quot;&lt;/code&gt; and &lt;code&gt;&amp;quot;iat&amp;quot;&lt;/code&gt; claims are validated.&lt;/p&gt;
&lt;p&gt;Consider validating that other claims match your expectations by using the &lt;code&gt;expect_claims&lt;/code&gt; configuration option.
Token claims must match exactly the values set here.&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;# This can be seen as a required &amp;#34;subset&amp;#34; of a JWT Claims Set.
expect_claims = {&amp;#34;iss&amp;#34;: &amp;#34;https://your-token-issuer&amp;#34;, &amp;#34;your-custom-claim&amp;#34;: &amp;#34;foo&amp;#34;}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;roles&#34;&gt;Roles&lt;/h2&gt;
&lt;p&gt;Grafana checks for the presence of a role using the &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; specified via the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option. The JMESPath is applied to JWT token claims. The result after evaluation of the &lt;code&gt;role_attribute_path&lt;/code&gt; JMESPath expression should be a valid Grafana role, for example, &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;/p&gt;
&lt;p&gt;To assign the role to a specific organization include the &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt; header along with your JWT when making API requests to Grafana.
To learn more about the header, please refer to the &lt;a href=&#34;../../../../developers/http_api/#x-grafana-org-id-header&#34;&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configure-role-mapping&#34;&gt;Configure role mapping&lt;/h3&gt;
&lt;p&gt;Unless &lt;code&gt;skip_org_role_sync&lt;/code&gt; option is enabled, the user&amp;rsquo;s role will be set to the role retrieved from the JWT.&lt;/p&gt;
&lt;p&gt;The user&amp;rsquo;s role is retrieved using a &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; expression from the &lt;code&gt;role_attribute_path&lt;/code&gt; configuration option.
To map the server administrator role, use the &lt;code&gt;allow_assign_grafana_admin&lt;/code&gt; configuration option.&lt;/p&gt;
&lt;p&gt;If no valid role is found, the user is assigned the role specified by &lt;a href=&#34;../../../configure-grafana/#auto_assign_org_role&#34;&gt;the &lt;code&gt;auto_assign_org_role&lt;/code&gt; option&lt;/a&gt;.
You can disable this default role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. This setting denies user access if no role or an invalid role is returned after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; and the &lt;code&gt;org_mapping&lt;/code&gt; expressions.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;org_attribute_path&lt;/code&gt; and &lt;code&gt;org_mapping&lt;/code&gt; configuration options to assign the user to organizations and specify their role. For more information, refer to &lt;a href=&#34;#org-roles-mapping-example&#34;&gt;Org roles mapping example&lt;/a&gt;. If both org role mapping (&lt;code&gt;org_mapping&lt;/code&gt;) and the regular role mapping (&lt;code&gt;role_attribute_path&lt;/code&gt;) are specified, then the user will get the highest of the two mapped roles.&lt;/p&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, go to &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; to test and evaluate expressions with custom payloads.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Basic example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the following example user will get &lt;code&gt;Editor&lt;/code&gt; as role when authenticating. The value of the property &lt;code&gt;role&lt;/code&gt; will be the resulting role if the role is a proper Grafana role, i.e. &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;/p&gt;
&lt;p&gt;Payload:&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;role&amp;#34;: &amp;#34;Editor&amp;#34;,
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;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;role_attribute_path = role&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Advanced example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the following example user will get &lt;code&gt;Admin&lt;/code&gt; as role when authenticating since it has a role &lt;code&gt;admin&lt;/code&gt;. If a user has a role &lt;code&gt;editor&lt;/code&gt; it will get &lt;code&gt;Editor&lt;/code&gt; as role, otherwise &lt;code&gt;Viewer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Payload:&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;info&amp;#34;: {
        ...
        &amp;#34;roles&amp;#34;: [
            &amp;#34;engineer&amp;#34;,
            &amp;#34;admin&amp;#34;,
        ],
        ...
    },
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;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;role_attribute_path = contains(info.roles[*], &amp;#39;admin&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Admin&amp;#39; || contains(info.roles[*], &amp;#39;editor&amp;#39;) &amp;amp;&amp;amp; &amp;#39;Editor&amp;#39; || &amp;#39;Viewer&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Org roles mapping example&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the following example, the , the user has been granted the role of a &lt;code&gt;Viewer&lt;/code&gt; in the &lt;code&gt;org_foo&lt;/code&gt; organization, and the role of an &lt;code&gt;Editor&lt;/code&gt; in the &lt;code&gt;org_bar&lt;/code&gt; and &lt;code&gt;org_baz&lt;/code&gt; organizations.&lt;/p&gt;
&lt;p&gt;Payload:&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;info&amp;#34;: {
        ...
        &amp;#34;orgs&amp;#34;: [
            &amp;#34;engineer&amp;#34;,
            &amp;#34;admin&amp;#34;,
        ],
        ...
    },
    ...
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;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;org_attribute_path = info.orgs
org_mapping = engineer:org_foo:Viewer admin:org_bar:Editor *:org_baz:Editor&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grafana-admin-role&#34;&gt;Grafana Admin Role&lt;/h3&gt;
&lt;p&gt;If the &lt;code&gt;role_attribute_path&lt;/code&gt; property returns a &lt;code&gt;GrafanaAdmin&lt;/code&gt; role, Grafana Admin is not assigned by default, instead the &lt;code&gt;Admin&lt;/code&gt; role is assigned. To allow &lt;code&gt;Grafana Admin&lt;/code&gt; role to be assigned set &lt;code&gt;allow_assign_grafana_admin = true&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;skip-organization-role-mapping&#34;&gt;Skip organization role mapping&lt;/h3&gt;
&lt;p&gt;To skip the assignment of roles and permissions upon login via JWT and handle them via other mechanisms like the user interface, we can skip the organization role synchronization with the following 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.jwt]
# ...

skip_org_role_sync = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-jwt-authentication">Configure JWT authentication&lt;/h1>
&lt;p>You can configure Grafana to accept a JWT token provided in the HTTP header. The token is verified using any of the following:&lt;/p></description></item></channel></rss>