Scripting authentication

Started by rmpf2

rmpf2

Scripting authentication   26 November 2020, 02:23

I have some scripts using the built-in telnet option. In each one there's a declaration for user and password to access the device. Any idea or advice on how to implement some kind of variable for the credentials? If the user or password change all the scripts have to be manually modified.

Example:
'Retrieve system info via Telnet
'This example code can be adapted to work
'with any device that supports the protocol

'Set credentials
user = "user1"
pass = "user1_password"

'Create internal Telnet object
set objTelnet = Internal.CreateObject("Telnet")
SoftPerfect Support forum - Andrew avatar image

Re: Scripting authentication   26 November 2020, 10:25

One way would be to store login settings in an external file, e.g. XML or plain text and read that file to access the credentials.

Another way, we may add a function to access the Network Scanner's credential manager from scripts, though the problem is identifying which user and password to use. The list of credentials simply consists of username-password pairs, and I am not sure how to specify in a script which user you want if two of them have the same name.
rmpf2

Re: Scripting authentication   27 November 2020, 00:12

Hi. Happy Thanksgiving Day. God bless you all!

You mentioned earlier the possibility to implement some kind of function to access the credential manager. How about a function to access the applications variables definition?
SoftPerfect Support forum - Andrew avatar image

Re: Scripting authentication   30 November 2020, 16:10

Yes, that can be done and we'll implement it soon.

At moment the Network Scanner application is undergoing a redesign with the aim of supporting both Windows and macOS to the maximum possible extent. To avoid having to merge new changes from different codebases, we'll add the requested feature once the redesign is complete (in ~2-3 weeks),
rmpf2

Re: Scripting authentication   29 November 2022, 05:25

With the new credential manager tag implementation would it be possible to use it on scripts using the built-in telnet option?

Would it be possible to define credentials for the Remote Performance Option?

Right know it appears to be using just the current credentials.
SoftPerfect Support forum - Andrew avatar image

Re: Scripting authentication   29 November 2022, 06:26

For scripts you can now use the same tag system, e.g.:
'Set credentials
user = Input.Username("tag")
pass = Input.Password("tag")
For Remote Performance, I am afraid the Windows API doesn't offer custom authentication and uses the current user account.

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **     **  **    **  ********   **     **  **    ** 
  **   **   **   **   **     **   **   **   ***   ** 
   ** **    **  **    **     **    ** **    ****  ** 
    ***     *****     **     **     ***     ** ** ** 
   ** **    **  **    **     **    ** **    **  **** 
  **   **   **   **   **     **   **   **   **   *** 
 **     **  **    **  ********   **     **  **    ** 

Message: