Cannot Login to grafana when embedded in iframe

Hi,

I want to embed my grafana instance in an iframe and login to grafana via there.
I have succesfully embedded grafana into my webpage, but when I login succesfully, it just takes me straight back to an empty login page.

Also I don’t want to enable anonymous access because you can then just visite my grafana instance and access all dashbaords without logging in.

Does anybody know a solution?

Can you try this:

Set to true to enable embedding Grafana dashboards in iframes

allow_embedding = true

[http]

Set to true to allow the browser to send and receive cookies from the iframe

cookie_samesite = true

[auth]

Enable cookie authentication

login_cookie_name = grafana_session
login_maximum_inactive_lifetime_days = 7
login_maximum_lifetime_days = 30
disable_login_form = false

Doesn’t work, but we came to a new solution for our use case.

@vijha1989
true is not a valid value for cookie_samesite, see documentation.

@maximbozek2002
Care to share what you did to solve it?

check this out How to embed Grafana dashboards into web applications | Grafana Labs