Hi Grafana team and community,
I’m experiencing an issue in Grafana 11.5.0 when using Google OAuth. After some time has passed since logging in, if I try to access a specific dashboard via a direct link, Grafana briefly redirects through /user/auth-tokens/rotate?redirectTo=..., but then sends me to the default home dashboard instead of the original URL I tried to open.
The expected behavior is that Grafana would return me to the specific dashboard I was trying to access. This is disruptive for users sharing or bookmarking dashboards.
All relevant configuration and details are below — I’d really appreciate any help understanding why this redirection fails and how to fix it.
What Grafana version and what operating system are you using?
Grafana 11.5.0 running in Docker
What are you trying to achieve?
I want users authenticated via Google OAuth to remain logged in for more than 10 minutes — ideally 1 hour of inactivity and 24 hours total session lifetime.
How are you trying to achieve it?
I modified my grafana.ini with the following settings:
[auth]
login_maximum_inactive_lifetime_duration = 1h
login_maximum_lifetime_duration = 24h
token_rotation_interval_minutes = 10
cookie_secure = true
cookie_samesite = strict
[auth.google]
enabled = true
client_id = xxxxxx.apps.googleusercontent.com
client_secret = xxxxxx
use_refresh_token = true
allowed_domains = xxx.com
I restarted the Grafana container after saving the changes.
What happened?
After login, Grafana sets the grafana_session cookie to expire exactly 10 minutes later — regardless of the settings. After 10 minutes of inactivity, accessing any dashboard URL redirects me to:
/grafana/user/auth-tokens/rotate?redirectTo=…
…then I’m redirected to the Grafana home page, instead of the dashboard I originally tried to access.
What did you expect to happen?
I expected the session cookie to last at least 1 hour (inactivity) and 24 hours (maximum), and for Grafana to remember and return to the originally requested dashboard after re-authentication.
Can you copy/paste the configuration(s) that you are having problems with?
Grafana config snippet:
[auth]
login_maximum_inactive_lifetime_duration = 1h
login_maximum_lifetime_duration = 24h
[auth.google]
enabled = true
client_id = xxxx
client_secret = xxxxxx
use_refresh_token = true
allowed_domains = xxxx
NGINX reverse proxy config for /grafana/:
location /grafana/ {
proxy_pass xxxx:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600;
}
Did you receive any errors in the Grafana UI or in related logs?
No visible errors in the UI. However, the session consistently expires at the 10-minute mark.
In DevTools, the grafana_session cookie always has an expiration 10 minutes after login.
Any help would be appreciated!