-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Download BeforeConnect.applescript from the latest release or clone the repository:
git clone https://github.com/SkyCMD-Labs/viscosity-otp.gitPut BeforeConnect.applescript somewhere permanent.
~/Library/Application Scripts/com.sparklabs.Viscosity/BeforeConnect.applescriptOr anywhere you prefer — Viscosity accepts any path.
Note
The same script file works for all VPN connections. You only need one copy.
For each VPN connection that uses OTP:
- Open Viscosity → Preferences
- Select the connection and click Edit
- Go to the Advanced tab
- Under Before Connect Script, click Select… and choose
BeforeConnect.applescript - Click Save
Repeat for any additional connections. Each connection can use a different OTP provider — the script reads the command from your configuration automatically.
After Configuration, test by connecting to your VPN. If everything is set up correctly, the OTP will be submitted automatically and you'll connect without any manual entry.
If something goes wrong, an error dialog will appear with details. See Troubleshooting for common issues.
To update, simply replace BeforeConnect.applescript with the new version. After replacing the file:
- Open Viscosity Preferences
- For each connection, clear the Before Connect Script and re-select the updated file
- Save
Important
Viscosity caches Before Connect scripts. You must clear and re-add the script after updating, or Viscosity will continue running the old version.