This is an Alfred workflow that allows you to retrieve one-time passwords for sites that use two-factor authentication. You set up the sites in Alfred, then you can pull the one time password for the site at any time with Alfred. The password is automatically copied to the clipboard.
- Install Node.js: http://nodejs.org/download/ or
brew install node
- Install this workflow by clicking on https://github.com/salamagd/alfred.2fa/raw/master/2FA.alfredworkflow, then opening the downloaded file.
- Setup two-factor authentication with some service (eg. GitHub, AWS, etc).
- Scan the barcode into your mobile app (eg. Authy or Google Authenticator) and note the secret key.
- Add the secret key into Alfred:
2f add [SERVICE_NAME] [SECRET_KEY]
- Use Alfred at any time to generate a one-time password and copy it to the clipboard:
2f [SERVICE_NAME]
2f add [SERVICE_NAME] [SECRET_KEY]
eg.:
2f add aws ASDJKS34DHUY12
2f [SERVICE_NAME]
eg.:
2f aws
2f delete [SERVICE_NAME]
eg.:
2f delete aws
Alfred feedback: https://github.com/lrrfantasy/alfred-feedback-xml-generation
OTP generation: https://www.npmjs.org/package/otp