02-02-2024 08:25 AM
Hi,
I currently have a project where consists in a main page which contains 4 hyperlinks to other 4 pages(where the data is displayed)
Im using Ni web server to save the tags(from labview), and in each page i have to use the open configuration node(systemlink data communication) to outpout the "configuration" value to open tag.vi , and then reading the tag values and displaying them.
I sawn an example where you disable the open open configuration block(the data isn´t displayed) until the credantials(login from ni web server) are ipnut, and it worked fine , however, in every page i have to input the credentials again.
1- (prefered way)
I wan wondering if i can disable the hyperlink untill i input the credentials (login from ni web server).Therefore , i wouldnt have to put credentials in every page, only in the index(main page).
2-
Another thing i thought was to disable the open configuration node in the main page until i input the credentials (same as the example before mentioned) , and somehow export the output("configuration") from the configuration node to the others webvis as a global variable, hence the data wont be displayed until the "configration" value is exported to the other pages.
Solved! Go to Solution.
02-02-2024 11:00 AM - edited 02-02-2024 11:03 AM
The expected workflow would be to not have the user enter credentials on the WebVIs themselves. Instead the Open Configuration would be removed from the WebVIs, the WebVIs would be built and hosted on the Web Application Hosting service on the NI Web Server.
Then when a user visits the NI Web Server they have to login and when the WebVI opens the logged in credentials are used automatically for calls to the data services like Tags and Messages. The How to Build a Web UI for Your LabVIEW-Based Test System from 31m41s to 32m44s shows the following points:
With the above workflow you should be able to keep the application organized with multiple top-level WebVIs and remove explicit login requirements from all of them. The user would just login to the NI Web Server and visit your application with the different URLs and select the page they need with the data displayed.
I'd recommend going through the content of How to Build a Web UI for Your LabVIEW-Based Test System as it gives a lot of useful context for patterns of testing and deploying WebVIs.
02-05-2024 08:46 AM
Thanks for the insight. I've already changed it, so you dont need to use open configuration on the web vi , only when testing it.
Furthermore , i am struggling to create a new user account(guest account where they can only see the webvi) and edit its privileges , i've come across this tutorial: Solucionado: How do I create a new user in SystemLink - NI Community
I did manage to create a new user,but the admin user disapeared and the new user didnt have any privelges.
Is it possible to have 2 users (admin and guest) using only ni web server ?
02-05-2024 04:40 PM
I'm not familiar with the approach linked from that separate forum. The direction I'd probably go is in the NI Web Server Configuration > Authentication enabling:
Then I would create a local account using Windows settings for a user like "webviguest" with a password:
I would login to the NI Web Server as "webviguest" account so that the NI Web Server is aware of it, and notice that it doesn't have access to any WebVIs or anything else yet:
I would log back into my admin account and make sure I see the "webviguest" user show up under users:
Continuing with the admin account I would create a new role for the user, something like "WebVI Only" that has permissions to view the WebVI but also other needed permissions for WebVIs to run like read and / or write access to certain tags or messages:
Continuing with the admin account I would go to the workspace configuration, edit the default workspace, and under members I would add the new user and expected roles, for example "webviguest" with the "WebVI Only" role:
I would log out of the admin account and wait several minutes for role changes to be picked up by the NII Web Server. After several minutes I would login as "webviguest" again. and notice that when I click the user menu > Account and look at workspaces that the "webviguest" user is in the default workspace with the assigned role of "WebVI Only":
And that the "webviguest" user can now access WebVIs on the web applications page:
02-09-2024 07:35 AM
Thanks again , that worked fine!!