dgeniusudesign

Registered
Apr 1, 2019
3
1
1
Dearborn, USA
cPanel Access Level
Website Owner
Hello all,

I think I have a weird issue. As mentioned in one of the threads on the site, I am using the calling
Code:
https://cPanelURL:2083/login/?login_only=1&user=username&pass=password
to login and get the security token. Then I am calling another function that needs the cpsess token in the URL.

The above scenario works well in Postman and I have tested it numerous time. However, when I try to do the same from my server(node.js), it fails. I am getting a security token successfully, but the second step fails. When I use the security token I get from server to test in Postman, it fails as well. I tried vice versa - I got the security token from a successful call in Postman and used it in my server. That fails as well.

I am not sure where I am missing a trick. Has anybody faced this? Any ideas on what to do now? I am stuck at a very interesting point.

Thanks in advance for the help :)

Regards,
Monish
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello Monish,

Can you the specific script you are using so we can use it when attempting to reproduce the issue? Ensure to remove any references to real domain names or IP addresses when pasting the script's contents here.

Thank you.
 

dgeniusudesign

Registered
Apr 1, 2019
3
1
1
Dearborn, USA
cPanel Access Level
Website Owner
Hello Michael,

Thank you for the reply. It seems like I was using the wrong authentication method. I was able to solve my issue using this package - npmjs.com/package/cpanel-node

Regards,
Monish
 
Last edited by a moderator:
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello Monish,

I'm happy to see you were able to get it working. Thanks for sharing the outcome!