Before Connect script generating credentials

Got a problem with Viscosity or need help? Ask here!

dsdobbins

Posts: 1
Joined: Mon May 24, 2021 11:41 pm

Post by dsdobbins » Tue May 25, 2021 2:11 am
I'm running Viscosity 1.9.3 (1571) and I've been trying to get my BeforeConnect script working to generate credentials. I've verified that my script returns the correct "userpass <username> <password>" values with no spaces or quotes in the actual username or password values. When I try to establish the VPN connection, though, Viscosity still prompts me for credentials and both the username and password values are empty. Any suggestions on how to debug this?

Another observation - when I cancel out of the credentials dialog, Viscosity still saves the password (but not the username) to the keychain. and the value is empty. If I delete the password value from the keychain, Viscosity replaces it the next time I try to connect, regardless of whether the "save credentials" checkbox is checked. Not sure if that's related or not.

Appreciate any ideas!

James

User avatar
Posts: 2312
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Tue May 25, 2021 3:29 pm
Hi dsdobbins,

I recommend making use of the AppleScript "display dialog" command to display exactly what is being sent to Viscosity at the end of your script so you can make sure it's correct.

As scripts running from Viscosity are being run from a different context to just running them under Script Editor, often you may find there is a pathing or environment option you didn't consider (especially when running commands from your script).

Another possibility is that the server is rejecting the username and password your script is sending. If the server reject's the credentials (or otherwise sends an Auth Failed response) Viscosity will automatically prompt for credentials.

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
2 posts Page 1 of 1