JWT authentication with url_login for Panel Embed

I’m trying to use URL Login with my JWT token generated by node jsonwebtoken package to embed a grafana panel into my webapp
this is my token payload:

{ "sub": 10, "userData": { "email": "[email]", "group": 1, "firstname": "Daniel", "lastname": "[lastname]" }, "iat": 1731311279, "exp": 1731314879 }

I’ve set the following in my grafana.ini:

`[security]
allow_embedding = true # Allow embedding

[auth.jwt]
url_login = true # enable JWT authentication in the URL
enabled = true
key_file = /etc/grafana/jwt_pub.key
url_parameter_name = auth_token
email_claim = userData.email
username_claim = userData.email
auto_sign_up = true`

However trying to embed a panel only leads me to the login page, any ideas what might be the issue?

  • What Grafana version and what operating system are you using?
    11.3 on Arch Linux

  • What happened?
    I’m getting redirected to Login page instead of getting displayed a Panel Embed

  • What did you expect to happen?
    Seeing the Panel Embed cause the JWT token was present in the &auth_token parameter

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly
    No, only log I could find which might be related is: grafana-1 | logger=context userId=0 orgId=0 uname= t=2024-11-11T08:29:38.185398063Z level=debug msg=“Failed to authenticate user in global scope” error=“[auth.identity.unsupported] invalid identity type”

Also, if you only have an idea how to debug the issue, I’ll be very glad :slight_smile:

what are you passing in the auth_token parameter?

My JWT Token, the payload is above.
I added the raw string (eyJ…)