Page 1 of 1

Before Connect script generating credentials

Posted: Tue May 25, 2021 2:11 am
by dsdobbins
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!

Re: Before Connect script generating credentials

Posted: Tue May 25, 2021 3:29 pm
by James
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