Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 1. Create a new password entry in Keychain Access called "ExnessLDAP" with your ldap password
- -- 2. Create a new password entry in Keychain Access called "Exness2Factor" with your 2fator token
- -- 3. Install oath-toolkit. (brew install oath-toolkit)
- -- 4. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
- -- 5. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
- -- 6. Enable the above .app so it can access Accessibility
- -- 7. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
- -- 8. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text.
- set targetApp to "Cisco AnyConnect Secure Mobility Client"
- set ExnessLDAPKeyChainKey to "ExnessLDAP"
- set Exness2FactorKeyChainKey to "Exness2Factor"
- tell application targetApp
- activate
- end tell
- tell application "System Events"
- repeat until (window 1 of process targetApp exists)
- delay 1
- end repeat
- repeat until (window 2 of process targetApp exists)
- delay 1
- end repeat
- tell process targetApp
- set PSWD to do shell script "/usr/bin/security find-generic-password -wl " & quoted form of ExnessLDAPKeyChainKey
- set Token to do shell script "/usr/bin/security find-generic-password -wl " & quoted form of Exness2FactorKeyChainKey
- set PSWD2 to do shell script "/usr/local/bin/oathtool --totp -b -d 6 " & quoted form of Token
- keystroke PSWD as text
- keystroke tab
- keystroke PSWD2 as text
- keystroke return
- end tell
- end tell
Add Comment
Please, Sign In to add comment