Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-14109

Grafana box renders raw JS when Grafana behind reverse proxy with SSO



    • 5
    • Horizon 22 - April 13 - 27, Horizon - April 27 - May 11
    • Backlog
    • 4


      I first observed this and thought it was due to the property org.opennms.grafanaBox.dashboardLimit being set and uncommented. The Grafana dashboard list box in the landing page renders Javascript instead of the intended content. See screenshot.

      The actual problem is that the Grafana instance is hosted behind a reverse proxy which is set to do single sign-on against an Azure Active Directory tenant. When the code behind the Grafana box tries to fetch the list of dashboards using the "public" Grafana URL configured via grafanaBox.hostname et al, it gets redirected to Microsoft's auth flow and things get very ugly throughout the OpenNMS landing page. On the other hand, if I set up grafanaBox.hostname et al to reflect values that skirt the reverse proxy, the dashboard list populates as expected and the box renders – but the links in the Grafana box are useless to a real user.

      Providing an optional second set of properties for grafanaBox.hostname, grafanaBox.protocol, grafanaBox.port, and grafanaBox.basePath which are used only for the API operations, while the primary properties' values are used for constructing the resultant links that render in the Grafana box, should do the trick without introducing any breaking config changes.


        Issue Links



              aramos-vizcarra Alberto
              jeffg Jeff Gehlbach
              0 Vote for this issue
              2 Start watching this issue