Enable anonymous authentication in Grafana

I’d like to enable anonymous authentication in Grafana so that the iframes including Grafana panels (in Hugo) do not require login.

I’m looking for an option like services.grafana.settings.security.allow_anonymous = true; or another way of achieving the same goal.

I am not really sure about this one, as I am not using Grafana on NixOS.

However juding from the source code of the NixOS module, have you tried this?

services.grafana.settings.auth.anonymous.enabled = true;

If this doesn’t work, I am not sure what the purpose of this line in the code below is otherwise. It looks like this option is supposed to exist and has been renamed, but I am not really sure if it actually does:

Yes, it does seem obvious except that I thought that the options at search.nixos.org/options are autogenerated based on the nix you referenced so they include all the options.

BTW, it’s slightly different: services.grafana.settings."auth.anonymous".enabled

Thanks!

Yes, that confused me too. That is why I wasn’t sure if it is really properly implemented. The fact that the option doesn’t show up in search is certainly a bug of sorts. Maybe you can write a bug report (after looking if it’s not already known of course). But it’s great if it works anyways.

You’re welcome!

Well, for now, I’m only sure that the option can be set. I’m not sure about its effect yet. Seems to me it doesn’t work, but I will check more thoroughly and report back.

1 Like

Just tested it. The following config works for me:

services.grafana.settings.auth.disable_login_form = true;
services.grafana.settings."auth.anonymous".enabled = true;
3 Likes