- Multi-Factor Auth CLI
- Table of Contents
- Description
- Pre-Requisites
- Environmental Variables
- Running the Application
This app creates a simple CLI tool used to create and verify multi-factor auth codes using Bandwidth's Multi-Factor Auth API. The app will prompt the user for their phone number, followed by their preferred method of code delivery; either messaging or voice. The app will then text or call the phone number provided with a 6 digit MFA code that the user can enter back into the CLI to verify.
In order to use the Bandwidth API users need to set up the appropriate application at the Bandwidth Dashboard and create API tokens.
To create an application log into the Bandwidth Dashboard and navigate to the Applications
tab. Fill out the New Application form selecting the service that the application will be used for (this sample app uses a messaging application).
For more information about API credentials see our Account Credentials page.
The sample app uses the below environmental variables.
BW_ACCOUNT_ID # Your Bandwidth Account Id
BW_USERNAME # Your Bandwidth API Username
BW_PASSWORD # Your Bandwidth API Password
BW_NUMBER # The Bandwidth phone number involved with this application
BW_VOICE_APPLICATION_ID # Your Voice Application Id created in the dashboard
BW_MESSAGING_APPLICATION_ID # Your Messaging Application Id created in the dashboard
Use the following command to run the application:
dotnet run