I am trying to use the auto-login script from the web site. Having a hard time getting it to work i found this errror message when i console.log(res). I’m using POST. I’d past code sample here, but it really is the script on the site.
Based on google search it might be my vpn, but not sure, and would greatly appreciate any ideas to fix/workaround. I just want to have a login script which captures a JSESSIONID from the cookie of a successful login. Thanks in advance to any and all.
Hello, could you please provide more details about the error message and the script? This will help us diagnose the issue more accurately.
Thank you for responding. I’ve been working on it to see if i could get further on my own but without success.
But i think I found it. Is there a way to set the User agent? specifically in a script?
actually, i think. i found that too. script still not working but now i’m back to drawing board. at least i’ve got these hurdles out of the way.
The help documentation also provides some script request examples for reference at Postman scripts reference - Apidog Docs.
Thank you. So, two things worth noting - neither related to AD but might be useful to someone outside of this conversation. 1: there was a hidden form field in the actual login page that i was missing. 2: the site was also validating only certain browser user agents.
For the hidden field I made a separate initial get request and used cheerio to extract the value in the form and then used that value in the actual login post that followed.
for the user agent i added this to the post request:
headers: {
"User-Agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
},
Thank you very for helping me through this. It is a criticial part of our adoption strategy.
i should mention that the APIdog Script generator on anakin.ai was critical to the cheerio solution. Thanks to all!