-
Notifications
You must be signed in to change notification settings - Fork 228
Home
Connie Leung edited this page Jan 17, 2017
·
10 revisions
#####Let's say you have a user that wants to enable two-factor authentication, and you intend to do two-factor authentication using an app like Google Authenticator, Duo Security, Authy, etc. This is a three-step process:
- Generate a secret
- Show a QR code for the user to scan in
- Authenticate the token for the first time
Use Speakeasy's key generator to get a key.
var secret = speakeasy.generateSecret();
// Returns an object with secret.ascii, secret.hex, and secret.base32.
// Also returns secret.otpauth_url, which we'll use later.