Best way to Access Grafana from external application

I have an application running in pivotal cloudfoundry. I need to access grafana dashboard without login from that application and i manage the authorization from that application. I need Grafana to be secured. No other users should view the grafana dashboard . Is there any way i can view grafana from app running in cloudfoundry apart from snapshots. I created snapshot and loaded in iframe. I want to know anyother way to access dashboard without login again like any token or authproxy? if yes , what should be the configuration and where should i run my grafana . As of now it is running in a different server not in cloudfoundry. Is there any way to allow only requests from particular domain without login ?

Maybe with Grafana’s authproxy?

http://docs.grafana.org/tutorials/authproxy/#grafana-authproxy

I have enabled auth proxy and configured ngnix for reverse proxy. Still I am seeing the login page when I iframe it my cloud foundry web application.

Is the http header (X-WEBAUTH-USER or whatever header you are using) being set and sent to Grafana?

Yes it is being set as per docs.It would be great if you provide any sample for configuration nginx.conf file

Is it working though? Can you see it in the server logs for grafana or in the request header getting sent to Grafana?

I don’t have a good sample nginx config. Should be something like this:

http://docs.grafana.org/installation/behind_proxy/#nginx-configuration

and if you are using basic auth then add the auth and set-header:

    auth_basic            'Restricted';
    auth_basic_user_file  <path/to/htpasswd_file>;
    proxy_set_header X-WEBAUTH-USER $remote_user;

P.S. in the future this will be easier: https://github.com/grafana/grafana/issues/3752

Thanks .Do I have to hardcode the remote user value in config. How to pass the user name in the request to the nginx

From the Nginx docs:

user name supplied with the Basic authentication

Thanks for your help… it worked. Waiting for that implementation mentioned in the auto login token

Is there any way to hide navigation menus

yes, kiosk mode:

Is there any way to display only time picker widget in kiosk mode to apply filters

Don’t really understand your use case. Why do you want kiosk mode and be able to apply filters? Grafana goes into view mode anyway after a while and hides everything (you can go straight into view mode by pressing d v (see keyboard shortcuts).

This is Grafana in view mode:

My usecase is I want to hide dashboard navigation. I am accessing it via proxy and embedding in iframe. I don’t want others to see the dashboard other than the particular dashboard. Is there any authorization feature like only particular view the dashboard. I want to hide only dashboard navigation box and not other

There is a viewer role but that does not stop the viewer from searching for dashboards. I don’t think we will be building a feature to hide parts of the UI into Grafana. Maybe you could hide it with some custom css?

I have this same use case. I want to use Kiosk mode (to hide all of the things I don’t want users to get into), but being able to filter by date/time is an important feature. View mode is essentially useless in this case because it can’t be turned on programmatically (like the kiosk mode can) (and can’t be locked so the user cannot exit View mode), so the user can still get access to things I don’t want.

We need to be able to have the Time Picker be available just like any other filter. For example, in Kibana, the Time Picker can be made available in a “Filter Panel”, which gives a lot of control about it’s placement and visibility. It would be great to have more flexibility about the placement and availability of the Time Picker in Grafana. Either as a regular Filter, or as a Panel. I looked for a custom plug-in panel offering Time Picker controls, but didn’t find one, so I’m not sure if a plugin would even be possible.

In summary, does anyone have suggestions to do any one of the following:

  1. Lock the dashboard in View mode?
  2. Enable the Time Picker while in Kiosk mode?
  3. Enable the Time Picker controls to be implemented as a Filter?
  4. Enable the Time Picker controls to be implemented as a Panel?

Thanks in advance!

Have you seen that you can make a dashboard readonly? It is the Editable toggle in the dashboard settings:

You could build your own Time Picker panel I think - that hides the Grafana time picker with css and then reimplements the time picker functionality in a custom panel. It would be quite lot of work though.

Hi,

can you share the NGINX config file