Grafana JWT, when refreshed in the browser (F5) in the dashboard, it redirects me to the login page

I am using grafana v.9.3.2 since docker. I configured grafana with JWT, this is my grafana.ini

protocol = http
http_port = 3003
domain =
root_url =

cookie_name = grafana_session
cookie_secure = false

admin_user = root
admin_password = root
cookie_samesite = disabled

disable_login_form = true

enabled = true
enable_login_token = true
header_name = x-token-auth-qa
username_claim = sub
email_claim = sub
jwk_set_file = /tmp/jwks.json
auto_sign_up = true
url_login = true
  1. I am getting access to the grafana using:

  2. I login correctly using the JWT

  3. I display the main menu of grafana

  4. I access one of my dashboards and it works correctly from the grafana controls
    But if I refresh (F5 or Reload this page option) from the chrome browser, it immediately redirects me to

What is my mistake, what can I do to continue working with JWT and work correctly even if I refresh the page from the browser?


Dairo Cortes

My stupid guess is that your auth token is expired. Do a standard debugging: increase grafana log level and check the logs.

I met same issue, I guess.
The token is not expired, and also there is x-jwt-assertion header in request section. After click a dashboard, the auth_token already disappeared in url, but the header of jwt still there, now works fine. Then I refresh the page manually by clicking refresh button of browser, it went to login page.
If I manually put the query auth_token back, it works again.
Many thanks for any help.

Instead of passing jwt token in url, putting jwt in header before accessing grafana can avoid this issue.

1 Like