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

Description

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.

Acceptance / Success Criteria

None

Attachments

1

Cannot finish until linked issue is finished.

Lucidchart Diagrams

Activity

Show:

Alberto May 9, 2022 at 8:31 PM

Merged to foundation-2022

Included changes from

Done

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

Estimated Days

Story Points

Components

Sprint

Affects versions

Priority

PagerDuty

Created March 24, 2022 at 2:32 PM
Updated May 10, 2022 at 5:35 PM
Resolved May 9, 2022 at 8:31 PM
Loading...