Additional Information
In order to define the roles that can view your web application, you need to create an XML file with access requirements. An example XML file is attached. Each section of the XML file is described below.
- Application
- A unique name must be given to the web application. This name is only used internally to the NI Web Server (Line 2)
- The description for the application will appear on the Applications tab of the NI Web Server Configuration. The description can be localized using the xml:lang property (Line 4)
- Privileges (Line 6)
- Each privilege you create will map to a specific Role and directory, defined in the XML. You can think of a Role as a person and a privilege as the "key" that enables them to access a web resource
- Each privilege requires a unique ID within the XML file (Line 8, 14, 18, 24)
- The description of the privilege will appear in the Applications tab under your application. (Line 10, 15, 19, 25)
- The role property defines the Role that will have a privilege (Line 12, 16, 20, 26)
- Routes
- A route is what defines the directory that will have privileged access
- Each privilege you create should map to a directory
- The path for your directory is relative to the htdocs folder inside of the NI Web Server (C:\Program Files\National Instruments\Shared Web Server\htdocs)
- In the example XML file, the path "/MyWebApp" refers to the absolute path C:\Program Files\National Instruments\Shared\Web Server\htdocs\MyWebApp
- There are resources that every WebVI requires in order to load in the browser. To ensure these resources are available to all privilege levels, we create a special privilege and route to these resources (Lines 24-27, 37)
Once you have defined your privileges and routes in the XML file, follow the steps in the Solution field to apply your configuration to the NI Web Server.
Avoid using spaces or special characters in the
role id of your XML file,
you will get an error when you open NI Web Server Configuration Tool, removing the character and repeating the commands will allow you to solve it.
If you would like to replace the logo that appears on the login screen after navigating to a restricted web resource, change C:\Program Files\National Instruments\Shared\Web Server\htdocs\login\css\style.css to point to a different image located in the C:\Program Files\National Instruments\Shared\Web Server\htdocs\login\assets folder.