Unable to reset operator password with api | Community
Skip to main content
Level 3
Oct 22, 2020 1:12 PM UTC
Solved

Unable to reset operator password with api

Hello,

I am trying to change an operator password with this JS code :

 

var resetPassword = NLWS.xtkOperator.ResetPassword("login123", "newpassword");

 

but I get Method 'ResetPassword' unknown in schema 'xtk:operator'.

 

Any clue why?

 

Thank you for your help,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
roro_coeurAccepted solution
Level 3
Oct 29, 2020 3:17 PM UTC

Using the method HashPassword works : 

NLWS.xtkSession.HashPassword("new_password");

And use the value to update the password column in the operator table.

7 replies

roro_coeurAuthorAccepted solution
Level 3
Oct 29, 2020 3:17 PM UTC

Using the method HashPassword works : 

NLWS.xtkSession.HashPassword("new_password");

And use the value to update the password column in the operator table.

Translate
New Participant
Oct 22, 2020 7:01 PM UTC

Hi @roro_coeur ,

 

Are you using the loadLibrary to load the method implementation ? Seems like workflow could not reference the method implementation.

Please add below.

loadLibrary("namespace:xxx.js"); // replace the placeholder with the .js information.

Translate
Level 3
Oct 29, 2020 1:08 PM UTC
Hi Mukesh, which library should I load? I don't see any operator.js livrary?
Translate
_Manoj_Kumar_
New Participant
Oct 22, 2020 1:47 PM UTC

Hello @roro_coeur ,

 

It seems you are trying to run this code via a javascript activity in a workflow.

You don't have administrator access that is why the reset password function is not accessible by your login.

 

You can check the journal tab for more information. You will see an error which says "XTK-170020 Non authorized access to requested service (right 'admin' needed)."

 

Operators with admin access can run this code without any issues.

 

Thanks,

Manoj

Translate
     Manoj     Find me on LinkedIn
Level 3
Oct 22, 2020 1:52 PM UTC
Hello Mano, I am running the workflow containing the js activity with an admin operator. And I don't get the "Non authorized access to requested service" message.
Translate