2022-05-26 23:06:25 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								aliases:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  -  /docs/grafana/latest/auth/overview/
							 
						 
					
						
							
								
									
										
										
										
											2022-06-16 01:25:58 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  -  /docs/grafana/latest/auth/
							 
						 
					
						
							
								
									
										
										
										
											2022-06-03 00:57:22 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  -  /docs/grafana/latest/setup-grafana/configure-security/configure-authentication/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								description: Learn about all the ways in which you can configure Grafana to authenticate
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  users.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								title: Configure authentication
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								weight: 100
							 
						 
					
						
							
								
									
										
										
										
											2022-05-26 23:06:25 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
									
										
										
										
											2018-08-13 20:28:41 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-03 00:57:22 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# Configure authentication
  
						 
					
						
							
								
									
										
										
										
											2018-08-13 20:28:41 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-16 05:33:37 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user permissions and org memberships.
							 
						 
					
						
							
								
									
										
										
										
											2018-08-31 13:15:07 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-03 00:57:22 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								The following table shows all supported authentication providers and the features available for them. [Team sync ]({{< relref "../configure-team-sync/" >}} ) and [active sync ]({{< relref "enhanced_ldap/#active-ldap-synchronization" >}} ) are only available in Grafana Enterprise.
							 
						 
					
						
							
								
									
										
										
										
											2020-05-13 17:23:01 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-03 00:57:22 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								| Provider                                         | Support | Role mapping | Team sync< br >  _(Enterprise only)_  | Active sync< br >  _(Enterprise only)_  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| ------------------------------------------------ | :-----: | :----------: | :-------------------------------: | :---------------------------------: |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [Auth Proxy ]({{< relref "auth-proxy/" >}} )       |  v2.1+  |      -       |               v6.3+               |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [Azure AD OAuth ]({{< relref "azuread/" >}} )      |  v6.7+  |    v6.7+     |               v6.7+               |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [Generic OAuth ]({{< relref "generic-oauth/" >}} ) |  v4.0+  |    v6.5+     |                 -                 |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [GitHub OAuth ]({{< relref "github/" >}} )         |  v2.0+  |      -       |               v6.3+               |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [GitLab OAuth ]({{< relref "gitlab/" >}} )         |  v5.3+  |      -       |               v6.4+               |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [Google OAuth ]({{< relref "google/" >}} )         |  v2.0+  |      -       |                 -                 |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [JWT ]({{< relref "jwt/" >}} )                     |  v8.0+  |      -       |                 -                 |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [LDAP ]({{< relref "ldap/" >}} )                   |  v2.1+  |    v2.1+     |               v5.3+               |                v6.3+                |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [Okta OAuth ]({{< relref "okta/" >}} )             |  v7.0+  |    v7.0+     |               v7.0+               |                  -                  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| [SAML ]({{< relref "saml/" >}} ) (Enterprise only) |  v6.3+  |    v7.0+     |               v7.0+               |                  -                  |
							 
						 
					
						
							
								
									
										
										
										
											2018-08-31 13:15:07 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								## Grafana Auth
  
						 
					
						
							
								
									
										
										
										
											2018-08-13 20:28:41 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-20 21:16:43 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Grafana of course has a built in user authentication system with password authentication enabled by default. You can
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth
							 
						 
					
						
							
								
									
										
										
										
											2020-09-22 15:58:28 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								provider (listed above). There are also options for allowing self sign up.
							 
						 
					
						
							
								
									
										
										
										
											2018-08-13 20:28:41 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								### Login and short-lived tokens
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-14 02:52:27 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								>  The following applies when using Grafana's built in user authentication, LDAP (without Auth proxy) or OAuth integration.
  
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Grafana are using short-lived tokens as a mechanism for verifying authenticated users.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								These short-lived tokens are rotated each `token_rotation_interval_minutes`  for an active authenticated user.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 01:03:02 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								An active authenticated user that gets it token rotated will extend the `login_maximum_inactive_lifetime_duration`  time from "now" that Grafana will remember the user.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This means that a user can close its browser and come back before `now + login_maximum_inactive_lifetime_duration`  and still being authenticated.
							 
						 
					
						
							
								
									
										
										
										
											2021-08-06 21:52:36 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								This is true as long as the time since user login is less than `login_maximum_lifetime_duration` .
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-05 14:20:21 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								#### Remote logout
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								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.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Settings
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Example:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Login cookie name
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								login_cookie_name = grafana_session
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-14 21:57:38 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# 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).
  
						 
					
						
							
								
									
										
										
										
											2020-11-10 04:26:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								login_maximum_inactive_lifetime_duration =
							 
						 
					
						
							
								
									
										
										
										
											2020-09-14 21:57:38 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# 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).
  
						 
					
						
							
								
									
										
										
										
											2020-11-10 04:26:49 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								login_maximum_lifetime_duration =
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								token_rotation_interval_minutes = 10
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 14:47:03 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 04:56:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# 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.
  
						 
					
						
							
								
									
										
										
										
											2019-06-26 14:47:03 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								api_key_max_seconds_to_live = -1
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 04:10:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-20 21:16:43 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								### Anonymous authentication
  
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								You can make Grafana accessible without any login required by enabling anonymous access in the configuration file.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Example:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[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
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								If you change your organization name in the Grafana UI this setting needs to be updated to match the new name.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Basic authentication
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Basic auth is enabled by default and works with the built in Grafana user password authentication system and LDAP
							 
						 
					
						
							
								
									
										
										
										
											2018-10-06 23:09:41 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								authentication integration.
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To disable basic auth:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth.basic]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								enabled = false
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Disable login form
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								You can hide the Grafana login form using the below configuration settings.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth]
							 
						 
					
						
							
								
									
										
										
										
											2018-05-28 22:15:31 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								disable_login_form = true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Automatic OAuth login
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-22 22:59:15 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Set to true to attempt login with OAuth automatically, skipping the login screen.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This setting is ignored if multiple OAuth providers are configured.
							 
						 
					
						
							
								
									
										
										
										
											2018-05-28 22:15:31 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Defaults to `false` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								oauth_auto_login = true
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-06 22:55:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								### Avoid automatic OAuth login
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-10 23:38:09 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								To sign in with a username and password and avoid automatic OAuth login, add the `disableAutoLogin`  parameter to your login URL.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								For example: `grafana.example.com/login?disableAutoLogin`  or `grafana.example.com/login?disableAutoLogin=true` 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-06 22:55:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								### Hide sign-out menu
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-31 23:40:44 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Set the option detailed below to true to hide sign-out menu link. Useful if you use an auth proxy or JWT authentication.
							 
						 
					
						
							
								
									
										
										
										
											2018-09-06 18:11:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								disable_signout_menu = true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2018-11-22 22:59:15 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### URL redirect after signing out
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 04:56:23 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from OAuth provider.
							 
						 
					
						
							
								
									
										
										
										
											2018-11-22 22:59:15 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[auth]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								signout_redirect_url =
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```