<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Authentication on Grafana Labs</title><link>https://grafana.com/docs/grafana/v8.4/auth/</link><description>Recent content in Authentication on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v8.4/auth/index.xml" rel="self" type="application/rss+xml"/><item><title>Overview</title><link>https://grafana.com/docs/grafana/v8.4/auth/overview/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/overview/</guid><content><![CDATA[&lt;h1 id=&#34;user-authentication-overview&#34;&gt;User Authentication Overview&lt;/h1&gt;
&lt;p&gt;Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user permissions and org memberships.&lt;/p&gt;
&lt;p&gt;Here is a table showing all supported authentication providers and the features available for them. &lt;a href=&#34;../../enterprise/team-sync/&#34;&gt;Team sync&lt;/a&gt; and &lt;a href=&#34;../../enterprise/enhanced_ldap/#active-ldap-synchronization&#34;&gt;active sync&lt;/a&gt; are only available in Grafana Enterprise.&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;Provider&lt;/th&gt;
              &lt;th style=&#34;text-align: center&#34;&gt;Support&lt;/th&gt;
              &lt;th style=&#34;text-align: center&#34;&gt;Role mapping&lt;/th&gt;
              &lt;th style=&#34;text-align: center&#34;&gt;Team sync&lt;br&gt; &lt;em&gt;(Enterprise only)&lt;/em&gt;&lt;/th&gt;
              &lt;th style=&#34;text-align: center&#34;&gt;Active sync&lt;br&gt; &lt;em&gt;(Enterprise only)&lt;/em&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../auth-proxy/&#34;&gt;Auth Proxy&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v2.1&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.3&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../azuread/&#34;&gt;Azure AD OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.7&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.7&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.7&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../generic-oauth/&#34;&gt;Generic OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v4.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.5&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../github/&#34;&gt;GitHub OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v2.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.3&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../gitlab/&#34;&gt;GitLab OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v5.3&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.4&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../google/&#34;&gt;Google OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v2.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../jwt/&#34;&gt;JWT&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v8.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../ldap/&#34;&gt;LDAP&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v2.1&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v2.1&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v5.3&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.3&#43;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../okta/&#34;&gt;Okta OAuth&lt;/a&gt;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v7.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v7.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v7.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;a href=&#34;../../enterprise/saml/&#34;&gt;SAML&lt;/a&gt; (Enterprise only)&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v6.3&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v7.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;v7.0&#43;&lt;/td&gt;
              &lt;td style=&#34;text-align: center&#34;&gt;-&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;grafana-auth&#34;&gt;Grafana Auth&lt;/h2&gt;
&lt;p&gt;Grafana of course has a built in user authentication system with password authentication enabled by default. You can
disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth
provider (listed above). There are also options for allowing self sign up.&lt;/p&gt;
&lt;h3 id=&#34;login-and-short-lived-tokens&#34;&gt;Login and short-lived tokens&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;The following applies when using Grafana&amp;rsquo;s built in user authentication, LDAP (without Auth proxy) or OAuth integration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana are using short-lived tokens as a mechanism for verifying authenticated users.
These short-lived tokens are rotated each &lt;code&gt;token_rotation_interval_minutes&lt;/code&gt; for an active authenticated user.&lt;/p&gt;
&lt;p&gt;An active authenticated user that gets it token rotated will extend the &lt;code&gt;login_maximum_inactive_lifetime_duration&lt;/code&gt; time from &amp;ldquo;now&amp;rdquo; that Grafana will remember the user.
This means that a user can close its browser and come back before &lt;code&gt;now &#43; login_maximum_inactive_lifetime_duration&lt;/code&gt; and still being authenticated.
This is true as long as the time since user login is less than &lt;code&gt;login_maximum_lifetime_duration&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&#34;remote-logout&#34;&gt;Remote logout&lt;/h4&gt;
&lt;p&gt;You can logout from other devices by removing login sessions from the bottom of your profile page. If you are
a Grafana admin user you can also do the same for any user from the Server Admin / Edit User view.&lt;/p&gt;
&lt;h2 id=&#34;settings&#34;&gt;Settings&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]

# Login cookie name
login_cookie_name = grafana_session


# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation (token_rotation_interval_minutes).
login_maximum_inactive_lifetime_duration =


# The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month).
login_maximum_lifetime_duration =

# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10

# The maximum lifetime (seconds) an API key can be used. If it is set all the API keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;anonymous-authentication&#34;&gt;Anonymous authentication&lt;/h3&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;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&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;h3 id=&#34;basic-authentication&#34;&gt;Basic authentication&lt;/h3&gt;
&lt;p&gt;Basic auth is enabled by default and works with the built in Grafana user password authentication system and LDAP
authentication integration.&lt;/p&gt;
&lt;p&gt;To disable basic auth:&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;h3 id=&#34;disable-login-form&#34;&gt;Disable login form&lt;/h3&gt;
&lt;p&gt;You can hide the Grafana login form using the below configuration settings.&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;h3 id=&#34;automatic-oauth-login&#34;&gt;Automatic OAuth login&lt;/h3&gt;
&lt;p&gt;Set to true to attempt login with OAuth automatically, skipping the login screen.
This setting is ignored if multiple OAuth providers are configured.
Defaults to &lt;code&gt;false&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;[auth]
oauth_auto_login = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;avoid-automatic-oauth-login&#34;&gt;Avoid automatic OAuth login&lt;/h3&gt;
&lt;p&gt;To sign in with a username and password and avoid automatic OAuth login, add the &lt;code&gt;disableAutoLogin&lt;/code&gt; parameter to your login URL.
For example: &lt;code&gt;grafana.example.com/login?disableAutoLogin&lt;/code&gt; or &lt;code&gt;grafana.example.com/login?disableAutoLogin=true&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;hide-sign-out-menu&#34;&gt;Hide sign-out menu&lt;/h3&gt;
&lt;p&gt;Set the option detailed below to true to hide sign-out menu link. Useful if you use an auth proxy or JWT authentication.&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_signout_menu = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;url-redirect-after-signing-out&#34;&gt;URL redirect after signing out&lt;/h3&gt;
&lt;p&gt;URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from OAuth 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;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]
signout_redirect_url =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="user-authentication-overview">User Authentication Overview&lt;/h1>
&lt;p>Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user permissions and org memberships.&lt;/p>
&lt;p>Here is a table showing all supported authentication providers and the features available for them. &lt;a href="../../enterprise/team-sync/">Team sync&lt;/a> and &lt;a href="../../enterprise/enhanced_ldap/#active-ldap-synchronization">active sync&lt;/a> are only available in Grafana Enterprise.&lt;/p></description></item><item><title>Grafana Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/grafana/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/grafana/</guid><content><![CDATA[&lt;h2 id=&#34;grafana-auth&#34;&gt;Grafana Auth&lt;/h2&gt;
&lt;p&gt;Grafana of course has a built in user authentication system with password authentication enabled by default. You can
disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth
provider (listed above). There is also options for allowing self sign up.&lt;/p&gt;
&lt;h3 id=&#34;login-and-short-lived-tokens&#34;&gt;Login and short-lived tokens&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;The following applies when using Grafana&amp;rsquo;s built in user authentication, LDAP (without Auth proxy) or OAuth integration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana are using short-lived tokens as a mechanism for verifying authenticated users.
These short-lived tokens are rotated each &lt;code&gt;token_rotation_interval_minutes&lt;/code&gt; for an active authenticated user.&lt;/p&gt;
&lt;p&gt;An active authenticated user that gets it token rotated will extend the &lt;code&gt;login_maximum_inactive_lifetime_duration&lt;/code&gt; time from &amp;ldquo;now&amp;rdquo; that Grafana will remember the user.
This means that a user can close its browser and come back before &lt;code&gt;now &#43; login_maximum_inactive_lifetime_duration&lt;/code&gt; and still being authenticated.
This is true as long as the time since user login is less than &lt;code&gt;login_maximum_lifetime_duration&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&#34;remote-logout&#34;&gt;Remote logout&lt;/h4&gt;
&lt;p&gt;You can logout from other devices by removing login sessions from the bottom of your profile page. If you are
a Grafana admin user you can also do the same for any user from the Server Admin / Edit User view.&lt;/p&gt;
&lt;h2 id=&#34;settings&#34;&gt;Settings&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]

# Login cookie name
login_cookie_name = grafana_session

# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days.
login_maximum_inactive_lifetime_duration = 7d

# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days.
login_maximum_lifetime_duration = 30d

# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10

# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;anonymous-authentication&#34;&gt;Anonymous authentication&lt;/h3&gt;
&lt;p&gt;You can make Grafana accessible without any login required by enabling anonymous access in the configuration file. For more information, refer to &lt;a href=&#34;../../administration/security/&#34;&gt;Implications of allowing anonymous access to dashboards&lt;/a&gt;.&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;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&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;h3 id=&#34;basic-authentication&#34;&gt;Basic authentication&lt;/h3&gt;
&lt;p&gt;Basic auth is enabled by default and works with the built in Grafana user password authentication system and LDAP
authentication integration.&lt;/p&gt;
&lt;p&gt;To disable basic auth:&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;h3 id=&#34;disable-login-form&#34;&gt;Disable login form&lt;/h3&gt;
&lt;p&gt;You can hide the Grafana login form using the below configuration settings.&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;h3 id=&#34;automatic-oauth-login&#34;&gt;Automatic OAuth login&lt;/h3&gt;
&lt;p&gt;Set to true to attempt login with OAuth automatically, skipping the login screen.
This setting is ignored if multiple OAuth providers are configured.
Defaults to &lt;code&gt;false&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;[auth]
oauth_auto_login = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;hide-sign-out-menu&#34;&gt;Hide sign-out menu&lt;/h3&gt;
&lt;p&gt;Set the option detailed below to true to hide sign-out menu link. Useful if you use an auth proxy or JWT authentication.&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_signout_menu = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;url-redirect-after-signing-out&#34;&gt;URL redirect after signing out&lt;/h3&gt;
&lt;p&gt;URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from oauth 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;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]
signout_redirect_url =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h2 id="grafana-auth">Grafana Auth&lt;/h2>
&lt;p>Grafana of course has a built in user authentication system with password authentication enabled by default. You can
disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth
provider (listed above). There is also options for allowing self sign up.&lt;/p></description></item><item><title>Auth Proxy</title><link>https://grafana.com/docs/grafana/v8.4/auth/auth-proxy/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/auth-proxy/</guid><content><![CDATA[&lt;h1 id=&#34;auth-proxy-authentication&#34;&gt;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
sync_ttl = 60
# 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;
&lt;p&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;/p&gt;
&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 grafana.ini 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 &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 htpasswd 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 httpd container using our custom httpd.conf and our htpasswd 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/password we created in the htpasswd file.&lt;/p&gt;
&lt;h3 id=&#34;team-sync-enterprise-only&#34;&gt;Team Sync (Enterprise only)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana Enterprise v6.3&#43;&lt;/p&gt;&lt;/blockquote&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;../team-sync/#enable-synchronization-for-a-team&#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; 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; 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;p&gt;&lt;a href=&#34;../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 settings &lt;code&gt;login_maximum_inactive_lifetime_days&lt;/code&gt; and &lt;code&gt;login_maximum_lifetime_days&lt;/code&gt; under &lt;code&gt;[auth]&lt;/code&gt; to control session
lifetime. &lt;a href=&#34;../overview/#login-and-short-lived-tokens&#34;&gt;Read more about login tokens&lt;/a&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="auth-proxy-authentication">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>JWT Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/jwt/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/jwt/</guid><content><![CDATA[&lt;h1 id=&#34;jwt-authentication&#34;&gt;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;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;../../administration/configuration/&#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. You could specify a claim that contains either a username or an email of the Grafana user.&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;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

# Cache TTL for data loaded from http endpoint.
cache_ttl = 60m&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;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;You might also want to validate that other claims are really what you expect them to be.&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;
]]></content><description>&lt;h1 id="jwt-authentication">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><item><title>LDAP Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/ldap/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/ldap/</guid><content><![CDATA[&lt;h1 id=&#34;ldap-authentication&#34;&gt;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;blockquote&gt;
&lt;p&gt;&lt;a href=&#34;../../enterprise/enhanced_ldap/&#34;&gt;Enhanced LDAP authentication&lt;/a&gt; is available in &lt;a href=&#34;/docs/grafana-cloud/&#34;&gt;Grafana Cloud Advanced&lt;/a&gt; and in &lt;a href=&#34;../../enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../enterprise/access-control/&#34;&gt;Fine-grained access control&lt;/a&gt; in Grafana Enterprise to understand how you can control access with fine-grained permissions.&lt;/p&gt;&lt;/blockquote&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;../../administration/configuration/&#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;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]
# 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 almost always be true (default) to allow new Grafana users to be created (if LDAP authentication is ok). If set to
# false only pre-existing Grafana users will be able to login (if LDAP authentication is ok).
allow_sign_up = 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;127.0.0.1&amp;#34;
# Default port is 389 or 636 if use_ssl = true
port = 389
# Set to true if LDAP server should use an encrypted TLS connection (either with STARTTLS or LDAPS)
use_ssl = false
# If set to true, use LDAP with STARTTLS instead of LDAPS
start_tls = false
# 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;

# 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;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;h2 id=&#34;ldap-debug-view&#34;&gt;LDAP Debug View&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana v6.4&#43;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana has an LDAP debug view built-in which allows you to test your LDAP configuration directly within Grafana. At the moment of writing, only Grafana admins can use the LDAP debug view.&lt;/p&gt;
&lt;p&gt;Within this view, you&amp;rsquo;ll be able to see which LDAP servers are currently reachable and test your current configuration.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 600px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/ldap_debug.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/ldap_debug.png&#34;data-srcset=&#34;/static/img/docs/ldap_debug.png?w=320 320w, /static/img/docs/ldap_debug.png?w=550 550w, /static/img/docs/ldap_debug.png?w=750 750w, /static/img/docs/ldap_debug.png?w=900 900w, /static/img/docs/ldap_debug.png?w=1040 1040w, /static/img/docs/ldap_debug.png?w=1240 1240w, /static/img/docs/ldap_debug.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;971&#34;height=&#34;436&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/ldap_debug.png&#34;
            alt=&#34;&#34;width=&#34;971&#34;height=&#34;436&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To use the debug view:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Type the username of a user that exists within any of your LDAP server(s)&lt;/li&gt;
&lt;li&gt;Then, press &amp;ldquo;Run&amp;rdquo;&lt;/li&gt;
&lt;li&gt;If the user is found within any of your LDAP instances, the mapping information is displayed&lt;/li&gt;
&lt;/ol&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 600px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/ldap_debug_mapping_testing.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/ldap_debug_mapping_testing.png&#34;data-srcset=&#34;/static/img/docs/ldap_debug_mapping_testing.png?w=320 320w, /static/img/docs/ldap_debug_mapping_testing.png?w=550 550w, /static/img/docs/ldap_debug_mapping_testing.png?w=750 750w, /static/img/docs/ldap_debug_mapping_testing.png?w=900 900w, /static/img/docs/ldap_debug_mapping_testing.png?w=1040 1040w, /static/img/docs/ldap_debug_mapping_testing.png?w=1240 1240w, /static/img/docs/ldap_debug_mapping_testing.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;1046&#34;height=&#34;762&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/ldap_debug_mapping_testing.png&#34;
            alt=&#34;&#34;width=&#34;1046&#34;height=&#34;762&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;bind&#34;&gt;Bind&lt;/h3&gt;
&lt;h4 id=&#34;bind-and-bind-password&#34;&gt;Bind and Bind Password&lt;/h4&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 memberOf attribute add these 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. So, if you change a user&amp;rsquo;s role in the Grafana Org. Users page, this change will be reset the next time the user logs in. If you
change the LDAP groups of a user, the change will take effect the next time the user logs in.&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 # Available in Grafana v5.3 and above

[[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;&amp;quot;Admin&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;Editor&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;Viewer&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_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. Available in Grafana v5.3 and above&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;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 will need to know the DN for the user based only on the submitted username.
Multiple DN templates can be 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 see &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, by changing &lt;code&gt;member_of&lt;/code&gt; in &lt;code&gt;[servers.attributes]&lt;/code&gt; to &amp;ldquo;dn&amp;rdquo; it 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;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 above example SSL is enabled and an encrypted port have been configured. If your Active Directory don&amp;rsquo;t support SSL please change &lt;code&gt;enable_ssl = false&lt;/code&gt; and &lt;code&gt;port = 389&lt;/code&gt;.
Please inspect your Active Directory configuration and documentation to find the correct settings. For more information about Active Directory and port requirements see &lt;a href=&#34;https://technet.microsoft.com/en-us/library/dd772723%28v=ws.10%29&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;link&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 info enable LDAP debug logging in the &lt;a href=&#34;../../administration/configuration/&#34;&gt;main config file&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;[log]
filters = ldap:debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="ldap-authentication">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>Enhanced LDAP Integration</title><link>https://grafana.com/docs/grafana/v8.4/auth/enhanced_ldap/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/enhanced_ldap/</guid><content><![CDATA[&lt;h1 id=&#34;enhanced-ldap-integration&#34;&gt;Enhanced LDAP integration&lt;/h1&gt;
&lt;p&gt;The enhanced LDAP integration adds additional functionality on top of the existing &lt;a href=&#34;../ldap/&#34;&gt;LDAP integration&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Enhanced LDAP integration is only available in Grafana Enterprise. For more information, refer to &lt;a href=&#34;../../enterprise/enhanced_ldap/&#34;&gt;Enhanced LDAP integration&lt;/a&gt; in &lt;a href=&#34;../../enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
]]></content><description>&lt;h1 id="enhanced-ldap-integration">Enhanced LDAP integration&lt;/h1>
&lt;p>The enhanced LDAP integration adds additional functionality on top of the existing &lt;a href="../ldap/">LDAP integration&lt;/a>.&lt;/p>
&lt;blockquote>
&lt;p>Enhanced LDAP integration is only available in Grafana Enterprise. For more information, refer to &lt;a href="../../enterprise/enhanced_ldap/">Enhanced LDAP integration&lt;/a> in &lt;a href="../../enterprise/">Grafana Enterprise&lt;/a>.&lt;/p></description></item><item><title>OAuth authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/generic-oauth/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/generic-oauth/</guid><content><![CDATA[&lt;h1 id=&#34;generic-oauth-authentication&#34;&gt;Generic OAuth authentication&lt;/h1&gt;
&lt;p&gt;You can configure many different OAuth2 authentication services with Grafana using the generic OAuth2 feature. Examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#generic-oauth-authentication&#34;&gt;Generic OAuth authentication&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#set-up-oauth2-with-auth0&#34;&gt;Set up OAuth2 with Auth0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#set-up-oauth2-with-bitbucket&#34;&gt;Set up OAuth2 with Bitbucket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#set-up-oauth2-with-centrify&#34;&gt;Set up OAuth2 with Centrify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#set-up-oauth2-with-onelogin&#34;&gt;Set up OAuth2 with OneLogin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#jmespath-examples&#34;&gt;JMESPath examples&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#role-mapping&#34;&gt;Role mapping&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#groups-mapping&#34;&gt;Groups mapping&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This callback URL must match the full HTTP address that you use in your browser to access Grafana, but with the suffixed path of &lt;code&gt;/login/generic_oauth&lt;/code&gt;.&lt;/p&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;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 = OAuth
icon = signin
enabled = true
client_id = YOUR_APP_CLIENT_ID
client_secret = YOUR_APP_CLIENT_SECRET
scopes =
empty_scopes = false
auth_url =
token_url =
api_url =
allowed_domains = mycompany.com mycompany.org
allow_sign_up = true
tls_skip_verify_insecure = false
tls_client_cert =
tls_client_key =
tls_client_ca =
use_pkce = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Set &lt;code&gt;api_url&lt;/code&gt; to the resource that returns &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; compatible information.&lt;/p&gt;
&lt;p&gt;You can also specify the SSL/TLS configuration used by the client.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;tls_client_cert&lt;/code&gt; to the path of the certificate.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;tls_client_key&lt;/code&gt; to the path containing the key.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;tls_client_ca&lt;/code&gt; to the path containing a trusted certificate authority list.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;tls_skip_verify_insecure&lt;/code&gt; controls whether a client verifies the server&amp;rsquo;s certificate chain and host name. If it is true, then SSL/TLS 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;/p&gt;
&lt;p&gt;Set &lt;code&gt;empty_scopes&lt;/code&gt; to true to use an empty scope during authentication. By default, Grafana uses &lt;code&gt;user:email&lt;/code&gt; as scope.&lt;/p&gt;
&lt;h3 id=&#34;email-address&#34;&gt;Email address&lt;/h3&gt;
&lt;p&gt;Grafana determines a user&amp;rsquo;s email address by querying the OAuth provider until it finds an e-mail address:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check for the presence of an e-mail address via the &lt;code&gt;email&lt;/code&gt; field encoded in the OAuth &lt;code&gt;id_token&lt;/code&gt; parameter.&lt;/li&gt;
&lt;li&gt;Check for the presence of an e-mail address 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;email_attribute_path&lt;/code&gt; configuration option. The JSON used for the path lookup is the HTTP response obtained from querying the UserInfo endpoint specified via the &lt;code&gt;api_url&lt;/code&gt; configuration option.
&lt;strong&gt;Note&lt;/strong&gt;: Only available in Grafana v6.4&#43;.&lt;/li&gt;
&lt;li&gt;Check for the presence of an e-mail address in the &lt;code&gt;attributes&lt;/code&gt; map encoded in the OAuth &lt;code&gt;id_token&lt;/code&gt; parameter. By default Grafana will perform a lookup into the attributes map using the &lt;code&gt;email:primary&lt;/code&gt; key, however, this is configurable and can be adjusted by using the &lt;code&gt;email_attribute_name&lt;/code&gt; configuration option.&lt;/li&gt;
&lt;li&gt;Query the &lt;code&gt;/emails&lt;/code&gt; endpoint of the OAuth provider&amp;rsquo;s API (configured with &lt;code&gt;api_url&lt;/code&gt;), then check for the presence of an email address marked as a primary address.&lt;/li&gt;
&lt;li&gt;If no email address is found in steps (1-4), then the email address of the user is set to an empty string.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;roles&#34;&gt;Roles&lt;/h3&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 the &lt;code&gt;id_token&lt;/code&gt; first. If there is no match, then the UserInfo endpoint specified via the &lt;code&gt;api_url&lt;/code&gt; configuration option is tried next. 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;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;For more information, refer to the &lt;a href=&#34;#jmespath-examples&#34;&gt;JMESPath examples&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;groups--teams&#34;&gt;Groups / Teams&lt;/h3&gt;
&lt;p&gt;Similarly, group mappings are made using &lt;a href=&#34;http://jmespath.org/examples.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;JMESPath&lt;/a&gt; with the &lt;code&gt;groups_attribute_path&lt;/code&gt; configuration option. The &lt;code&gt;id_token&lt;/code&gt; is attempted first, followed by the UserInfo from the &lt;code&gt;api_url&lt;/code&gt;. The result of the JMESPath expression should be a string array of groups.&lt;/p&gt;
&lt;p&gt;Furthermore, Grafana will check for the presence of at least one of the teams specified via the &lt;code&gt;team_ids&lt;/code&gt; configuration option 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;team_ids_attribute_path&lt;/code&gt; configuration option. The JSON used for the path lookup is the HTTP response obtained from querying the Teams endpoint specified via the &lt;code&gt;teams_url&lt;/code&gt; configuration option (using &lt;code&gt;/teams&lt;/code&gt; as a fallback endpoint). The result should be a string array of Grafana Team IDs. Using this setting ensures that only certain teams is allowed to authenticate to Grafana using your OAuth provider.&lt;/p&gt;
&lt;h3 id=&#34;login&#34;&gt;Login&lt;/h3&gt;
&lt;p&gt;Customize user login using &lt;code&gt;login_attribute_path&lt;/code&gt; configuration option. Order of operations is as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Grafana evaluates the &lt;code&gt;login_attribute_path&lt;/code&gt; JMESPath expression against the ID token.&lt;/li&gt;
&lt;li&gt;If Grafana finds no value, then Grafana evaluates expression against the JSON data obtained from UserInfo endpoint. The UserInfo endpoint URL is specified in the &lt;code&gt;api_url&lt;/code&gt; configuration option.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can customize the attribute name used to extract the ID token from the returned OAuth token with the &lt;code&gt;id_token_attribute_name&lt;/code&gt; option.&lt;/p&gt;
&lt;p&gt;You can set the user&amp;rsquo;s display name with JMESPath using the &lt;code&gt;name_attribute_path&lt;/code&gt; configuration option. It operates the same way as the &lt;code&gt;login_attribute_path&lt;/code&gt; option.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;name_attribute_path&lt;/code&gt; is available in Grafana 7.4&#43;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;pkce&#34;&gt;PKCE&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Available in Grafana v8.3 and later versions.&lt;/p&gt;&lt;/blockquote&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 introduces
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;p&gt;You can enable PKCE in Grafana by setting &lt;code&gt;use_pkce&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the
&lt;code&gt;[auth.generic_oauth]&lt;/code&gt; section.&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;use_pkce = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana always uses the SHA256 based &lt;code&gt;S256&lt;/code&gt; challenge method and a 128 bytes (base64url encoded) code verifier.&lt;/p&gt;
&lt;h2 id=&#34;set-up-oauth2-with-auth0&#34;&gt;Set up OAuth2 with Auth0&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Client in Auth0&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 Settings tab and set:&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 Save Changes, then use the values at the top of the page to configure 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;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
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
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&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;set-up-oauth2-with-bitbucket&#34;&gt;Set up OAuth2 with Bitbucket&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;[auth.generic_oauth]
name = BitBucket
enabled = true
allow_sign_up = true
client_id = &amp;lt;client id&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 =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;set-up-oauth2-with-centrify&#34;&gt;Set up OAuth2 with Centrify&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Custom OpenID Connect application configuration in the Centrify dashboard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a memorable unique Application ID, e.g. &amp;ldquo;grafana&amp;rdquo;, &amp;ldquo;grafana_aws&amp;rdquo;, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Put in other basic configuration (name, description, logo, category)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the Trust tab, generate a long password and put it into the OpenID Connect Client Secret field.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Put the URL to the front page of your Grafana instance into the &amp;ldquo;Resource Application URL&amp;rdquo; field.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add an authorized Redirect URI like https://your-grafana-server/login/generic_oauth&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set up permissions, policies, etc. just like any other Centrify app&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure Grafana as follows:&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 = Centrify
enabled = true
allow_sign_up = true
client_id = &amp;lt;OpenID Connect Client ID from Centrify&amp;gt;
client_secret = &amp;lt;your generated OpenID Connect Client Secret&amp;#34;
scopes = openid profile email
auth_url = https://&amp;lt;your domain&amp;gt;.my.centrify.com/OAuth2/Authorize/&amp;lt;Application ID&amp;gt;
token_url = https://&amp;lt;your domain&amp;gt;.my.centrify.com/OAuth2/Token/&amp;lt;Application ID&amp;gt;
api_url = https://&amp;lt;your domain&amp;gt;.my.centrify.com/OAuth2/UserInfo/&amp;lt;Application ID&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;set-up-oauth2-with-onelogin&#34;&gt;Set up OAuth2 with OneLogin&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Custom Connector 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;p&gt;then:&lt;/p&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;p&gt;then:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under the SSO tab on the Grafana App details page you&amp;rsquo;ll find the Client ID and Client Secret.&lt;/p&gt;
&lt;p&gt;Your OneLogin Domain will match the URL you use to access OneLogin.&lt;/p&gt;
&lt;p&gt;Configure Grafana as follows:&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
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;h2 id=&#34;jmespath-examples&#34;&gt;JMESPath examples&lt;/h2&gt;
&lt;p&gt;To ease configuration of a proper JMESPath expression, you can test/evaluate expressions with custom payloads at &lt;a href=&#34;http://jmespath.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://jmespath.org/&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;role-mapping&#34;&gt;Role mapping&lt;/h3&gt;
&lt;p&gt;If  the&lt;code&gt;role_attribute_path&lt;/code&gt; property does not return a role, then the user is assigned the &lt;code&gt;Viewer&lt;/code&gt; role by default. You can disable the role assignment by setting &lt;code&gt;role_attribute_strict = true&lt;/code&gt;. It denies user access if no role or an invalid role is returned.&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;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;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;&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;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(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;h3 id=&#34;groups-mapping&#34;&gt;Groups mapping&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Available in Grafana Enterprise v8.1 and later versions.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;With Team Sync you can map your Generic OAuth groups to teams in Grafana so that the users are automatically added to the correct teams.&lt;/p&gt;
&lt;p&gt;Generic OAuth groups can be referenced by group ID, like &lt;code&gt;8bab1c86-8fba-33e5-2089-1d1c80ec267d&lt;/code&gt; or &lt;code&gt;myteam&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;../team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&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;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 = info.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;info&amp;#34;: {
        ...
        &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;
]]></content><description>&lt;h1 id="generic-oauth-authentication">Generic OAuth authentication&lt;/h1>
&lt;p>You can configure many different OAuth2 authentication services with Grafana using the generic OAuth2 feature. Examples:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="#generic-oauth-authentication">Generic OAuth authentication&lt;/a>
&lt;ul>
&lt;li>&lt;a href="#set-up-oauth2-with-auth0">Set up OAuth2 with Auth0&lt;/a>&lt;/li>
&lt;li>&lt;a href="#set-up-oauth2-with-bitbucket">Set up OAuth2 with Bitbucket&lt;/a>&lt;/li>
&lt;li>&lt;a href="#set-up-oauth2-with-centrify">Set up OAuth2 with Centrify&lt;/a>&lt;/li>
&lt;li>&lt;a href="#set-up-oauth2-with-onelogin">Set up OAuth2 with OneLogin&lt;/a>&lt;/li>
&lt;li>&lt;a href="#jmespath-examples">JMESPath examples&lt;/a>
&lt;ul>
&lt;li>&lt;a href="#role-mapping">Role mapping&lt;/a>&lt;/li>
&lt;li>&lt;a href="#groups-mapping">Groups mapping&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>This callback URL must match the full HTTP address that you use in your browser to access Grafana, but with the suffixed path of &lt;code>/login/generic_oauth&lt;/code>.&lt;/p></description></item><item><title>Google OAuth2 Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/google/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/google/</guid><content><![CDATA[&lt;h1 id=&#34;google-oauth2-authentication&#34;&gt;Google OAuth2 Authentication&lt;/h1&gt;
&lt;p&gt;To enable Google OAuth2 you must register your application with Google. Google will generate a client ID and secret key for you to use.&lt;/p&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;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;Application Type: Web Application&lt;/li&gt;
&lt;li&gt;Name: Grafana&lt;/li&gt;
&lt;li&gt;Authorized JavaScript Origins: &lt;a href=&#34;https://grafana.mycompany.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grafana.mycompany.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Authorized Redirect URLs: &lt;a href=&#34;https://grafana.mycompany.com/login/google&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grafana.mycompany.com/login/google&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Replace &lt;a href=&#34;https://grafana.mycompany.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grafana.mycompany.com&lt;/a&gt; with the URL of your Grafana instance.&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;enable-google-oauth-in-grafana&#34;&gt;Enable Google OAuth in Grafana&lt;/h2&gt;
&lt;p&gt;Specify the Client ID and Secret in the &lt;a href=&#34;../../administration/configuration/#config-file-locations&#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
client_id = CLIENT_ID
client_secret = CLIENT_SECRET
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
allowed_domains = mycompany.com mycompany.org
allow_sign_up = 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 back-end. 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;
]]></content><description>&lt;h1 id="google-oauth2-authentication">Google OAuth2 Authentication&lt;/h1>
&lt;p>To enable Google OAuth2 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>Azure AD OAuth2 authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/azuread/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/azuread/</guid><content><![CDATA[&lt;h1 id=&#34;azure-ad-oauth2-authentication&#34;&gt;Azure AD OAuth2 authentication&lt;/h1&gt;
&lt;p&gt;The Azure AD authentication allows you to use an Azure Active Directory tenant as an identity provider for Grafana. You can use Azure AD Application Roles to assign users and groups to Grafana roles from the Azure Portal. This topic has the following sections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#create-the-azure-ad-application&#34;&gt;Create the Azure AD application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#enable-azure-ad-oauth-in-grafana&#34;&gt;Enable Azure AD OAuth in Grafana&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-the-azure-ad-application&#34;&gt;Create the Azure AD application&lt;/h2&gt;
&lt;p&gt;To enable the Azure AD OAuth2, register your application with Azure AD.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to &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;Azure Active Directory&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 Azure AD 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 following 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;, then 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&lt;/li&gt;
&lt;li&gt;Expires: Never&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 value. This is the OAuth client secret.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Manifest&lt;/strong&gt;, then define the required Application Role values for Grafana: Viewer, Editor, or Admin. If not defined, all users will have the Viewer role. Every role requires a unique ID 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;/li&gt;
&lt;li&gt;
&lt;p&gt;Include the unique ID in the configuration file:&lt;/p&gt;
&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;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 admin Users&amp;#34;,
     			&amp;#34;displayName&amp;#34;: &amp;#34;Grafana 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;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Azure Active Directory&lt;/strong&gt; and then to &lt;strong&gt;Enterprise Applications&lt;/strong&gt;. Search for your application and click on it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on &lt;strong&gt;Users and Groups&lt;/strong&gt; and add Users/Groups to the Grafana roles by using &lt;strong&gt;Add User&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;enable-azure-ad-oauth-in-grafana&#34;&gt;Enable Azure AD OAuth in Grafana&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add the following to the &lt;a href=&#34;../../administration/configuration/#config-file-locations&#34;&gt;Grafana configuration file&lt;/a&gt;:&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;[auth.azuread]
name = Azure AD
enabled = true
allow_sign_up = true
client_id = APPLICATION_ID
client_secret = CLIENT_SECRET
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 =&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;strong&gt;client_id&lt;/strong&gt; and &lt;strong&gt;client_secret&lt;/strong&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_ID
GF_AUTH_AZUREAD_CLIENT_SECRET&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Verify that the Grafana &lt;a href=&#34;../../administration/configuration/#root-url&#34;&gt;root_url&lt;/a&gt; is set in your Azure Application Redirect URLs.&lt;/p&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 who are members of one or more groups, set &lt;code&gt;allowed_groups&lt;/code&gt;
to a comma- or space-separated list of group object IDs. You can find object IDs for a specific group on the Azure portal:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Azure Active Directory -&amp;gt; Groups&lt;/strong&gt;. If you want to only give access to members of the group &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_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;Verify that &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-group-claims#configure-the-azure-ad-application-registration-for-group-attributes&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;group attributes&lt;/a&gt; is enabled in your Azure AD Application Registration manifest file by navigating to &lt;strong&gt;Azure Portal&lt;/strong&gt; &amp;gt; &lt;strong&gt;Azure Active Directory&lt;/strong&gt; &amp;gt; &lt;strong&gt;Application Registrations&lt;/strong&gt; &amp;gt; &lt;strong&gt;Select Application&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Manifest&lt;/strong&gt;, and 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;&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;team-sync-enterprise-only&#34;&gt;Team Sync (Enterprise only)&lt;/h3&gt;
&lt;p&gt;With Team Sync you can map your Azure AD 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 Azure AD 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;../team-sync/&#34;&gt;Team Sync&lt;/a&gt; documentation.&lt;/p&gt;
]]></content><description>&lt;h1 id="azure-ad-oauth2-authentication">Azure AD OAuth2 authentication&lt;/h1>
&lt;p>The Azure AD authentication allows you to use an Azure Active Directory tenant as an identity provider for Grafana. You can use Azure AD Application Roles to assign users and groups to Grafana roles from the Azure Portal. This topic has the following sections:&lt;/p></description></item><item><title>GitHub OAuth2 Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/github/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/github/</guid><content><![CDATA[&lt;h1 id=&#34;github-oauth2-authentication&#34;&gt;GitHub OAuth2 Authentication&lt;/h1&gt;
&lt;p&gt;To enable the GitHub OAuth2 you must register your application with GitHub. GitHub will generate a client ID and secret key for you to use.&lt;/p&gt;
&lt;h2 id=&#34;configure-github-oauth-application&#34;&gt;Configure GitHub OAuth application&lt;/h2&gt;
&lt;p&gt;You need to create a GitHub OAuth application (you will find this under the GitHub
settings page). When you create the application you will need to specify
a callback URL. Specify this as callback:&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;http://&amp;lt;my_grafana_server_name_or_ip&amp;gt;:&amp;lt;grafana_server_port&amp;gt;/grafana/login/github&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This callback URL must match the full HTTP address that you use in your
browser to access Grafana, but with the suffix path of &lt;code&gt;/login/github&lt;/code&gt;.
When the GitHub OAuth application is created you will get a Client ID and a
Client Secret. Specify these in the Grafana configuration file. For
example:&lt;/p&gt;
&lt;h2 id=&#34;enable-github-in-grafana&#34;&gt;Enable GitHub in Grafana&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;[auth.github]
enabled = true
allow_sign_up = 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
team_ids =
allowed_organizations =&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 back-end. You should now see a GitHub login button
on the login page. You can now login or sign up with your GitHub
accounts.&lt;/p&gt;
&lt;p&gt;You may allow users to sign-up via GitHub 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 GitHub authentication will be
automatically signed up.&lt;/p&gt;
&lt;h3 id=&#34;team_ids&#34;&gt;team_ids&lt;/h3&gt;
&lt;p&gt;Require an active team membership for at least one of the given teams on
GitHub. If the authenticated user isn&amp;rsquo;t a member of at least one of the
teams they will not be able to register or authenticate with your
Grafana instance. 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.github]
enabled = true
client_id = YOUR_GITHUB_APP_CLIENT_ID
client_secret = YOUR_GITHUB_APP_CLIENT_SECRET
scopes = user:email,read:org
team_ids = 150,300
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&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;allowed_organizations&#34;&gt;allowed_organizations&lt;/h3&gt;
&lt;p&gt;Require an active organization membership for at least one of the given
organizations on GitHub. If the authenticated user isn&amp;rsquo;t a member of at least
one of the organizations they will not be able to register or authenticate with
your Grafana instance. 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.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
# space-delimited organization names
allowed_organizations = github google&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;team-sync-enterprise-only&#34;&gt;Team Sync (Enterprise only)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana Enterprise v6.3&#43;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;With Team Sync you can map your GitHub org teams to teams in Grafana so that your users will automatically be added to
the correct teams.&lt;/p&gt;
&lt;p&gt;Your 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;Example: &lt;code&gt;@grafana/developers&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;../team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="github-oauth2-authentication">GitHub OAuth2 Authentication&lt;/h1>
&lt;p>To enable the GitHub OAuth2 you must register your application with GitHub. GitHub will generate a client ID and secret key for you to use.&lt;/p></description></item><item><title>GitLab OAuth2 Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/gitlab/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/gitlab/</guid><content><![CDATA[&lt;h1 id=&#34;gitlab-oauth2-authentication&#34;&gt;GitLab OAuth2 Authentication&lt;/h1&gt;
&lt;p&gt;To enable GitLab OAuth2 you must register the application in GitLab. GitLab will generate a client ID and secret key for you to use.&lt;/p&gt;
&lt;h2 id=&#34;create-gitlab-oauth-keys&#34;&gt;Create GitLab OAuth keys&lt;/h2&gt;
&lt;p&gt;You need to &lt;a href=&#34;https://docs.gitlab.com/ce/integration/oauth_provider.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;create a GitLab OAuth application&lt;/a&gt;.
Choose a descriptive &lt;em&gt;Name&lt;/em&gt;, and use the following &lt;em&gt;Redirect URI&lt;/em&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;https://grafana.example.com/login/gitlab&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;where &lt;code&gt;https://grafana.example.com&lt;/code&gt; is the URL you use to connect to Grafana.
Adjust it as needed if you don&amp;rsquo;t use HTTPS or if you use a different port; for
instance, if you access Grafana at &lt;code&gt;http://203.0.113.31:3000&lt;/code&gt;, you should use&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://203.0.113.31:3000/login/gitlab&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, select &lt;em&gt;read_api_as the_Scope_and submit the form. Note that if you&amp;rsquo;re
not going to use GitLab groups for authorization (i.e. not setting
&lt;code&gt;allowed_groups&lt;/code&gt;, see below), you can select_read_user&lt;/em&gt; instead of &lt;em&gt;read_api_as
the_Scope&lt;/em&gt;, thus giving a more restricted access to your GitLab API.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll get an &lt;em&gt;Application Id&lt;/em&gt; and a &lt;em&gt;Secret&lt;/em&gt; in return; we&amp;rsquo;ll call them
&lt;code&gt;GITLAB_APPLICATION_ID&lt;/code&gt; and &lt;code&gt;GITLAB_SECRET&lt;/code&gt; respectively for the rest of this
section.&lt;/p&gt;
&lt;h2 id=&#34;enable-gitlab-in-grafana&#34;&gt;Enable GitLab in Grafana&lt;/h2&gt;
&lt;p&gt;Add the following to your Grafana configuration file to enable GitLab
authentication:&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 = false
client_id = GITLAB_APPLICATION_ID
client_secret = GITLAB_SECRET
scopes = read_api
auth_url = https://gitlab.com/oauth/authorize
token_url = https://gitlab.com/oauth/token
api_url = https://gitlab.com/api/v4
allowed_groups =&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 for your changes to take effect.&lt;/p&gt;
&lt;p&gt;If you use your own instance of GitLab instead of &lt;code&gt;gitlab.com&lt;/code&gt;, adjust
&lt;code&gt;auth_url&lt;/code&gt;, &lt;code&gt;token_url&lt;/code&gt; and &lt;code&gt;api_url&lt;/code&gt; accordingly by replacing the &lt;code&gt;gitlab.com&lt;/code&gt;
hostname with your own.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;allow_sign_up&lt;/code&gt; set to &lt;code&gt;false&lt;/code&gt;, only existing users will be able to login
using their GitLab account, but with &lt;code&gt;allow_sign_up&lt;/code&gt; set to &lt;code&gt;true&lt;/code&gt;, &lt;em&gt;any&lt;/em&gt; user
who can authenticate on GitLab will be able to login on your Grafana instance;
if you use the public &lt;code&gt;gitlab.com&lt;/code&gt;, it means anyone in the world would be able
to login on your Grafana instance.&lt;/p&gt;
&lt;p&gt;You can limit access to only members of a given group or list of
groups by setting the &lt;code&gt;allowed_groups&lt;/code&gt; option.&lt;/p&gt;
&lt;h3 id=&#34;allowed_groups&#34;&gt;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. For instance, if you want to
only give access to members of the &lt;code&gt;example&lt;/code&gt; group, set&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;allowed_groups = example&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you want to also give access to members of the subgroup &lt;code&gt;bar&lt;/code&gt;, which is in
the group &lt;code&gt;foo&lt;/code&gt;, set&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;allowed_groups = example, foo/bar&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that in GitLab, the group or subgroup name doesn&amp;rsquo;t 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;Here&amp;rsquo;s a complete example with &lt;code&gt;allow_sign_up&lt;/code&gt; enabled, with access limited to
the &lt;code&gt;example&lt;/code&gt; and &lt;code&gt;foo/bar&lt;/code&gt; groups. The example also promotes all GitLab Admins to Grafana Admins:&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
allow_sign_up = true
client_id = GITLAB_APPLICATION_ID
client_secret = GITLAB_SECRET
scopes = read_api
auth_url = https://gitlab.com/oauth/authorize
token_url = https://gitlab.com/oauth/token
api_url = https://gitlab.com/api/v4
allowed_groups = example, foo/bar
role_attribute_path = is_admin &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;h3 id=&#34;map-roles&#34;&gt;Map roles&lt;/h3&gt;
&lt;p&gt;You can use GitLab OAuth to map roles. During mapping, 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.&lt;/p&gt;
&lt;p&gt;For the path lookup, Grafana uses JSON obtained from querying GitLab&amp;rsquo;s API &lt;a href=&#34;https://docs.gitlab.com/ee/api/users.html#list-current-user-for-normal-users&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;/api/v4/user&lt;/code&gt;&lt;/a&gt; endpoint. The result of evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; JMESPath expression must be a valid Grafana role, for example, &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 about roles and permissions in Grafana, refer to &lt;a href=&#34;../../permissions/organization_roles/&#34;&gt;Organization roles&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;An example Query could look like the following:&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 = is_admin &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;p&gt;This allows every GitLab Admin to be an Admin in Grafana.&lt;/p&gt;
&lt;h3 id=&#34;team-sync-enterprise-only&#34;&gt;Team Sync (Enterprise only)&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana Enterprise v6.4&#43;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;With Team Sync you can map your GitLab groups to teams in Grafana so that your users will automatically be added to
the correct teams.&lt;/p&gt;
&lt;p&gt;Your GitLab groups can be referenced in the same way as &lt;code&gt;allowed_groups&lt;/code&gt;, like &lt;code&gt;example&lt;/code&gt; or &lt;code&gt;foo/bar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;../team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="gitlab-oauth2-authentication">GitLab OAuth2 Authentication&lt;/h1>
&lt;p>To enable GitLab OAuth2 you must register the application in GitLab. GitLab will generate a client ID and secret key for you to use.&lt;/p></description></item><item><title>Okta OAuth2 authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/okta/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/okta/</guid><content><![CDATA[&lt;h1 id=&#34;okta-oauth2-authentication&#34;&gt;Okta OAuth2 authentication&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana v7.0&#43;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The Okta authentication allows your Grafana users to log in by using an external Okta authorization server.&lt;/p&gt;
&lt;h2 id=&#34;create-an-okta-application&#34;&gt;Create an Okta application&lt;/h2&gt;
&lt;p&gt;Before you can sign a user in, you need to create an Okta application from the Okta Developer Console.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to the &lt;a href=&#34;https://login.okta.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Okta portal&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to Admin and then select &lt;strong&gt;Developer Console&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Applications&lt;/strong&gt;, then &lt;strong&gt;Add Application&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pick &lt;strong&gt;Web&lt;/strong&gt; as the platform.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a name for your application (or leave the default value).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the &lt;strong&gt;Base URI&lt;/strong&gt; of your application, such as &lt;a href=&#34;https://grafana.example.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grafana.example.com&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter values for the &lt;strong&gt;Login redirect URI&lt;/strong&gt;. Use &lt;strong&gt;Base URI&lt;/strong&gt; and append it with &lt;code&gt;/login/okta&lt;/code&gt;, for example: &lt;a href=&#34;https://grafana.example.com/login/okta&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grafana.example.com/login/okta&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Done&lt;/strong&gt; to finish creating the Okta application.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;enable-okta-oauth-in-grafana&#34;&gt;Enable Okta OAuth in Grafana&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add the following to the &lt;a href=&#34;../../administration/configuration/#config-file-locations&#34;&gt;Grafana configuration file&lt;/a&gt;:&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.okta]
name = Okta
icon = okta
enabled = true
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = openid profile email groups
auth_url = https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/authorize
token_url = https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/token
api_url = https://&amp;lt;tenant-id&amp;gt;.okta.com/oauth2/v1/userinfo
allowed_domains =
allowed_groups =
role_attribute_path =&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-allowed-groups-and-domains&#34;&gt;Configure allowed groups and domains&lt;/h3&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 Okta 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;allowed_groups = Developers, Admins&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;allowed_domains&lt;/code&gt; option limits access to the users belonging to the specific domains. Domains should be separated by space or comma.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;allowed_domains = mycompany.com mycompany.org&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;Grafana can attempt to do role mapping through Okta OAuth. In order to achieve this, 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.&lt;/p&gt;
&lt;p&gt;Grafana uses JSON obtained from querying the &lt;code&gt;/userinfo&lt;/code&gt; endpoint for the path lookup. The result after evaluating the &lt;code&gt;role_attribute_path&lt;/code&gt; JMESPath expression needs to be a valid Grafana role, i.e. &lt;code&gt;Viewer&lt;/code&gt;, &lt;code&gt;Editor&lt;/code&gt; or &lt;code&gt;Admin&lt;/code&gt;. Refer to &lt;a href=&#34;../../permissions/organization_roles/&#34;&gt;Organization roles&lt;/a&gt; for more information about roles and permissions in Grafana.&lt;/p&gt;
&lt;p&gt;Read about how to &lt;a href=&#34;https://developer.okta.com/docs/guides/customize-tokens-returned-from-okta/add-custom-claim/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;add custom claims&lt;/a&gt; to the user info in Okta. Also, check Generic OAuth page for &lt;a href=&#34;generic-oauth.md/#jmespath-examples&#34;&gt;JMESPath examples&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;team-sync-enterprise-only&#34;&gt;Team Sync (Enterprise only)&lt;/h3&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 name, like &lt;code&gt;Admins&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;../../enterprise/team-sync/&#34;&gt;Learn more about Team Sync&lt;/a&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="okta-oauth2-authentication">Okta OAuth2 authentication&lt;/h1>
&lt;blockquote>
&lt;p>Only available in Grafana v7.0+&lt;/p>&lt;/blockquote>
&lt;p>The Okta authentication allows your Grafana users to log in by using an external Okta authorization server.&lt;/p></description></item><item><title>SAML Authentication</title><link>https://grafana.com/docs/grafana/v8.4/auth/saml/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/saml/</guid><content><![CDATA[&lt;h1 id=&#34;saml-authentication&#34;&gt;SAML authentication&lt;/h1&gt;
&lt;p&gt;The SAML authentication integration allows your Grafana users to log in by using an external SAML 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;blockquote&gt;
&lt;p&gt;SAML authentication integration is available in Grafana Cloud Pro and Advanced and in Grafana Enterprise. For more information, refer to &lt;a href=&#34;../../enterprise/saml/&#34;&gt;SAML authentication&lt;/a&gt; in &lt;a href=&#34;../../enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
]]></content><description>&lt;h1 id="saml-authentication">SAML authentication&lt;/h1>
&lt;p>The SAML authentication integration allows your Grafana users to log in by using an external SAML 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>Team Sync</title><link>https://grafana.com/docs/grafana/v8.4/auth/team-sync/</link><pubDate>Sat, 04 Apr 2026 12:26:57 +0000</pubDate><guid>https://grafana.com/docs/grafana/v8.4/auth/team-sync/</guid><content><![CDATA[&lt;h1 id=&#34;team-sync&#34;&gt;Team sync&lt;/h1&gt;
&lt;p&gt;With Team Sync, you can set up synchronization between your auth provider&amp;rsquo;s teams and teams in Grafana. This enables LDAP or GitHub OAuth users which are members
of certain teams/groups to automatically be added/removed as members to certain teams in Grafana. Currently the synchronization will only happen every
time a user logs in, unless LDAP is used together with active background synchronization that was added in Grafana 6.3.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow docs-image--right&#34;
    style=&#34;max-width: 600px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/enterprise/team_members_ldap.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/enterprise/team_members_ldap.png&#34;data-srcset=&#34;/static/img/docs/enterprise/team_members_ldap.png?w=320 320w, /static/img/docs/enterprise/team_members_ldap.png?w=550 550w, /static/img/docs/enterprise/team_members_ldap.png?w=750 750w, /static/img/docs/enterprise/team_members_ldap.png?w=900 900w, /static/img/docs/enterprise/team_members_ldap.png?w=1040 1040w, /static/img/docs/enterprise/team_members_ldap.png?w=1240 1240w, /static/img/docs/enterprise/team_members_ldap.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;979&#34;height=&#34;382&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/enterprise/team_members_ldap.png&#34;
            alt=&#34;&#34;width=&#34;979&#34;height=&#34;382&#34;class=&#34;docs-image--no-shadow docs-image--right&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Grafana keeps track of all synchronized users in teams and you can see which users have been synchronized 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 (for example) changes. This mechanism also enables 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;div class=&#34;clearfix&#34;&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Team Sync is available in both Grafana Enterprise and Grafana Cloud Advanced. For more information, refer to &lt;a href=&#34;../../enterprise/team-sync/&#34;&gt;Team sync&lt;/a&gt; in &lt;a href=&#34;../../enterprise/&#34;&gt;Grafana Enterprise&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
]]></content><description>&lt;h1 id="team-sync">Team sync&lt;/h1>
&lt;p>With Team Sync, you can set up synchronization between your auth provider&amp;rsquo;s teams and teams in Grafana. This enables LDAP or GitHub OAuth users which are members
of certain teams/groups to automatically be added/removed as members to certain teams in Grafana. Currently the synchronization will only happen every
time a user logs in, unless LDAP is used together with active background synchronization that was added in Grafana 6.3.&lt;/p></description></item></channel></rss>