08-12-2022 05:36 AM
Hi
I'm trying to figure out how the login screen from NI Web Server works.
My web server is running and is accessible under https://localhost:8081/MyWebServer
But if I try to login ( https://localhost:8081/) it always says that it doesn't find a web application.
If I open the NI Web Server Configuration it also shows "No web applications are installed"
So at the moment I can access the web server without using the login screen by directly going to the URL (https://localhost:8081/MyWebServer) and if I go to the login screen and try to login it doesn't forward me to the actual running web app.
In my opinion I should be prohibited to directly go to the URL (https://localhost:8081/MyWebServer) without logging in first and logging in should actually forward me to the web page.
How can I fix this?
09-02-2022 08:19 AM
Dear Phil717,
In order to let the user access web server you have to check weather the session is active. For the sessions I suggest reading https://www.ni.com/docs/en-US/bundle/labview/page/lvcomm/web_services_sessions.html this article. You need to first check weather the session is active and if so you need to redirect the page you want.
And for the links. The problem arises when you try to access the url that is not mentioned in your code, if you have nothing written for the link localhost:8081:/ It'll not show anything. Try writing a code for that address and access it once more. It'll show something then.
Best,
Anasei.
09-06-2022 08:33 AM - edited 09-06-2022 08:41 AM
The session VIs do not work anymore with the new NI Web Server. They only work with the application web server.
But I have kind of found a way how to make it work.
It seems that I can't secure a HTML page which is in the Public Content folder of the LabVIEW project but if the HTML page is loaded via a Web Resources VI (for example put the HTML code as a string into the VI or load it from a file) it would work.
That seems like a pretty unnecessary workaround but I haven't found another way to do it.
To secure a Web Resources VI one has to configure privileges in the web service properties.
One can than set the required privilege for a Web Resource VI
This privilege can than also be selected in the NI Web Server Configuration. But this doesn't seem to have any effect.