Hi,
I have scripted dashboard that I am calling in my web application and I am generating the URL of the dashboard based on the device selected, which is random.
In the URL I am passing the device name and property and property unit and a few other arguments to generate a graph chart based on the argument inputs.
Below is the URL that is generated.
Original URL:
https://ServerName/grafana/dashboard/script/ScriptedDashboard.js?kiosk&orgId=1&deviceName=Test_Device_1&propertiesName=%7b%22Water_Level%22%7d&propertiesUnit=%7b%22%25%22%7d&from=1666031400000&to=1681756200000&viewType=graph
owever, when I run this URL and if Grafana is not logged in it will redirect to the login page as expected. But when sign-in with SSO is done and the scripted dashboard URL is loaded it appears to be modified as below. And is showing the below errors appear on the screen.
Modified URL after SSO Sign-in:
https://ServerName/grafana/dashboard/script/ScriptedDashboard.js?kiosk&orgId=1&deviceName=Test_Device_1&propertiesName={%22Water_Level%22}&propertiesUnit={%22%%22}&from=1666031400000&to=1681756200000&viewType=graph
I further investigated the error coming using browser console logs.
The issue is appearing in cases where the propertiesUnit is set as “%”.
In the original URL the properties unit argument is as below.
propertiesUnit=%7b%22%25%22%7d
whereas after sign-in redirect it becomes below.
propertiesUnit={%22%%22}
Which means at the time of redirect it is resolving/decoding some of the escape characters like
%7b → {
%7d → }
%22 → "
%25 → %
But when this modified URL runs, it is not getting a raw URL and the % character is not getting decoded/resolved the script is giving an error.
At the time of sign-in, it should store the original URL, but that is not the case here.
My question is why and where this URL is getting modified at the time of SSO sign-in.
How can I prevent it from happening, and what can be done to fix this issue?
Moreover, instead of SSO sign-in if I log in using Basic Authentication, it does not create any issues.
So how do I verify where actually the issue is occurring?
Any help would be very much appreciated.
Note: I got these issue after upgrading Grafana from v6.5.2 to v8.4.10
These issues did not exist in the earlier version mentioned.
Thanks and Regards,
Bhushan Deshmukh