Passing roles to grafana iframe from parent

We are trying to integrate grafana in our UX. We have credentials to login in into our UX. Grafana is shown inside an iframe. The behavior we want to achieve is if someone logins with 'admin’role, it should map to ‘admin’ role of grafana, when he clicks on the grafana tab on our UX. Similary, if the role is ‘guest’, it should map to ‘viewer-only’ role in grafana. Was thinking of using JWT Bearer token based Oauth to fix this. The flow will be:

  1. User logins and get the jwt token as cookie from our backend, which has the grafana-role also embedded inside it.
  2. User clicks on the grafana tab within our UX, the above cookie hits the grafana server.
  3. Grafana server interprets the cookie and maps to appropriate role in grafana. For e.g., admin gets the admin view, guest gets the viewer-only view, etc.

Is there an already available plugin for this?
Can someone point me to some documentation as to how to write a plugin??
Appreciate your help.

1 Like

This is a not use case we are supporting right now. A few other people have tried this:

Docs for developing plugins.

Curious to know who did you solve this? We are also thinking to embed Grafana but need that level of permissions for users.

Looking forward to hear from you. I appreciate it.

1 Like