Grafana box renders raw JS when Grafana behind reverse proxy with SSO
Description
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
AlbertoAlbertoReporter
Jeff GehlbachJeff GehlbachHB Grooming Date
Mar 29, 2022HB Backlog Status
BacklogEstimated Days
4Story Points
5Components
Sprint
NoneFix versions
Affects versions
Priority
Minor
Details
Details
Assignee

Reporter

HB Grooming Date
Mar 29, 2022
HB Backlog Status
Backlog
Estimated Days
4
Story Points
5
Components
Sprint
None
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

PagerDuty Incident
Created March 24, 2022 at 2:32 PM
Updated May 10, 2022 at 5:35 PM
Resolved May 9, 2022 at 8:31 PM
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 upgrafanaBox.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
, andgrafanaBox.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.