Code for Slalom QE Summit 2019: 2-Factor Authentication
Note only tested out on Mac.
$ git clone git@github.com:knappkeith/two-factor-auth-automation.git
-or-
$ git clone https://github.com/knappkeith/two-factor-auth-automation.git
$ cd two-factor-auth-automation
$ pip install -r requirements.txt
You will need to at least have Chrome installed.
You will need to set up Mailosaur and Twilio:
- Twilio:
- sign-up
- you will get some free money $$$
- buy a number, cost is $1 / month, receive text ~ $0.007
- get your Auth Key and SID, Save for later
- Mailosaur:
- sign-up
- 14 day free trial
- create a server, save server id for later
- get your API Key, save for later
For these 'tests' to work you will need to have accounts for the following with the correct type of 2-Factor set up:
- SFDC - SMS (use twilio phone number)
- Comcast/Xfinity - Email (I used my personal then forwarded the email to the mailosaur service)
- Trello - Authenticator App (I used a QR reader to read the secret from the QR code, but also put it in Google Authentictor)
Not that I don't like you all but I don't want to give all my creds so you will need to create a creds file. You can find an example creds_template.json
- Copy the template:
$ cp creds_template.json ~/2fa_creds.json
- Edit your copy and enter the needed info
comcast
:username
: your Comcast User Namepassword
: your Comcast Passwordmailosaur.search_str
: your Comcast email for 2 factor
sfdc
:username
: your SFDC User Namepassword
: your SFDC Password
trello
:username
: your Trello User Namepassword
: your Trello Passwordauth_app_secret
: your secret from the QR codeverify_element_id
: [optional] the id of the element for your avatar img in the upper right corner
- Set your creds path environment variable:
$ export CREDS_PATH='~/2fa_creds.json'
To Run all three examples:
$ pytest --html=reports/report.html -v -s
To Run a specific test:
$ pytest --html=reports/report.html -v -s -m {sfdc/comcast/trello}