SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a new user in SystemLink

Solved!
Go to solution

Some of the posts on this is pretty outdated or the documentation probably doesn't exists. Running on SystemLink 20.6, and I can't seem to figure out how to create a new user. 

 

Currently just using the basic authentication method (manage by the web server). I don't really have a plan to go Windows Authentication as it's going to be pretty messy creating machine accounts working with the REST API.

 

image.png

 

 

0 Kudos
Message 1 of 8
(3,601 Views)
Solution
Accepted by topic author Mason.Chou

Hi Mason, 

 

This is possible (details below), but depending on what you intend on testing you may have to use a Windows account (or another supported account type - LDAP, Active Directory, OpenID Connect) in order to create the mappings needed to assign a user a role within a workspace. I suspect this constraint will prevent you from using users controlled by the web server. 

 


 

While, it's to use simpler to use Windows accounts for such tests, you can create new users within the web server using C:\Program Files\National Instruments\Shared\Web Server\htpasswd.exe. When you do this you will likely want to use -c option to create a new password file (refer to httpd docs for details). This file will have to be placed in C:\Program Files\National Instruments\Shared\Web Server\conf, but note you may need to create the file else where and move it into the conf directory with elevated privileges. You will also need to modify C:\Program Files\National Instruments\Shared\Web Server\conf\conf.d\50_ni_authn.conf to point to your new password file. This will look something like:

 

...  
  # Authentication module settings
    <IfDefine AUTHN_FILE_ENABLED>
        AuthUserFile ${HTCONF_PATH}/.htpasswd-your-new-pw-file
    ...

 

Restart the web server to enable the change. 

 

When deploying SystemLink in a production environment, NI recommends disabling the option to "Log in as users controlled by the web server". Instead, using LDAP, Active Directory, or OpenID Connect to achieve a greater degree of security by leveraging established corporate authentication policies and mechanisms. Please let me know if you have questions about this recommendation. 

Mark
NI App Software R&D
0 Kudos
Message 2 of 8
(3,566 Views)

Thanks Mark, this works out great!

0 Kudos
Message 3 of 8
(3,550 Views)

Hey Mark, just a quick question on authentication using Window Users. Is it possible to do role mappings on the SystemLink Server's local system account?

 

I'm trying to figure out the best way to authenticate an account to do automatic uploads Test Monitor (using the REST API). Maybe there's some insight you can help me out here.

 

Thanks!

0 Kudos
Message 4 of 8
(3,540 Views)

Yes,  you should be able to create role mappings for any Windows account on the server. The Windows User attribute is likely the simplest property to create a mapping. Since you are using the Test Monitor API you might consider making the machine that is running the test application a managed node of SystemLink rather than using user credentials in your test program. Basically, I encourage you to not include username and passwords in your test applications. Managed nodes work around this by using the credentials supplied to the tester (node) when it get added to the sever. Our first class APIs in LabVIEW and C# know where those credentials are on disk and fetch them automatically. 

 

https://www.ni.com/documentation/en/systemlink/latest/systemlink-labview-node-ref/open-configuration...

https://github.com/ni/systemlink-client-docs/wiki/Core

 

What language are you using to call the REST APIs? 

Mark
NI App Software R&D
0 Kudos
Message 5 of 8
(3,515 Views)

We're doing this in Python. We do have these systems as nodes in our SystemLink server. The API I received when setting this up doesn't seem to support auto credentials fetching, but let me know otherwise.

0 Kudos
Message 6 of 8
(3,505 Views)

Hi Mason, 

 

I hope this example can help. 

https://github.com/ni/systemlink-server-examples/blob/master/python/testmonitor/results/results.py

 

In this API (as in most of our Python API) if you do not manually specify credentials for the client it will automatically try and fetch credentials from disk. If this is running on a managed node, as you stated you were in this case, this capability should just work. You can see how this should work in https://your-systemlink-server/niapis/python/_modules/systemlink/clients/nitestmonitor/api_client.html#ApiClient. 

 

Let me know if you have follow up questions or if this resolves the current questions. 

Mark
NI App Software R&D
0 Kudos
Message 7 of 8
(3,477 Views)

Hey Mark, just tried out what you did and it worked out great. Thanks a lot!

Message 8 of 8
(3,462 Views)