I’m a newbie. First of all, thank you for OR being here.
I want to make “Insights” visible without logging in.
I’m running the latest version of OR on a VPS with Ubuntu 20.
I have a single asset that measures temperature and humidity. The asset has the “Public read” option enabled, and both the humidity and temperature attributes are also set to public.
I created an “Insight” with two widgets (temperature + humidity). In the insight settings, I selected Permissions > View > Public.
When I’m logged in, the Insights link works as expected: https://iot.xoxofoto.cz/insights/?realm=master#/view/[ID of insights]/true
However, when I open the link in an incognito window, I see an E401 error in the console, and the screen is completely blank.
The console shows the following error request:
GET request to https://iot.xoxofoto.cz/auth/realms/master/account
Response: {"error": "HTTP 401 Unauthorized"}
I think this is a bug that is accidentally introduced, being unaware of ‘public’ apps like Insights.
As I can reproduce it on our demo (OpenRemote Insights), I’ll raise a GitHub issue on this.
Thanks for reporting!
The GitHub issue I’ve created (linked above) hasn’t been picked up nor resolved yet.
I’ll try to pick it up when I find the time, although I’m quite busy at the moment
Unfortunately I’m not aware of a simple workaround, other than making users login.
This bug got introduced due to a change on November 15th, 2024. Only manually building the Docker images will allow you to deploy OpenRemote without this bug.
Now when I send the Insight url to a “public” recipient, they are seeing the login screen (instead of a blank screen).
The ThingAsset I am using for testing has the “Public read property” set to true. Both the temperature and humidity attributes I am using for testing have their “Access public read” properties set to true.
Is it possible to send someone the url of an Insight for viewing without them having to login? If yes, any idea what I’m missing?
Oh that’s odd. I didn’t encounter this during testing…
I double checked on my local environment, by creating a new asset (in any realm),
marking the asset as “public read”, and adding “access public read” config item to an attribute.
I created a dashboard with a single “Attribute Input” widget, showing the value of that asset.
I also double checked the dashboard was public.
Now, let’s see if the public can access it;
Test scenario 1
After saving, I clicked the “open in new tab” icon on the top right,
that opened the standalone Insights page. To check if I can still open it without logging in,
I copy the link, and paste it into a new incognito window. I didn’t get a login prompt, and was
able to see the attribute value inside the “Attribute Input” widget.
Test scenario 2
I navigated to “https://[hostname]/insights/” without any dashboard ID specified.
It redirects to the public dashboard ID automatically, and the hamburger menu only shows public dashboards.
.
Important information
The login page is shown when either;
on ‘/view/’, the dashboard could not be retrieved through the HTTP API.
For example, due to no access, or an invalid dashboard. (please check network logs)
on ‘/’ (without specifying an ID), when no public dashboards could be retrieved at all.
We assume that only realm/private dashboards are present, so a login form is shown.
.
Maybe I haven’t covered a scenario you are using public dashboards for?
Let me know!
After reading your step-by-step, I realized I hadn’t clicked on “open in new tab” and instead was copying and pasting the url from the master realm! Doh!!
Now I’m feeling pretty silly! Price you pay for being a newbie!!
Thank you so much for your clear instructions, though I’m sure they were there in your documentation all along. I apologize for the disruption, I know you’re a busy guy!