This example application demonstrates how to use Authy as the two-factor authentication provider in an ASP.NET MVC project using ASP.NET Identity.
For more information on how this code works, check out our interactive code walkthrough.
-
First clone this repository and
cd
into its directory:git clone git@github.com:TwilioDevEd/authy2fa-csharp.git cd authy2fa-csharp
-
Create a new file
Authy2FA/Local.config
and update the content with:<appSettings> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="AuthyKey" value="your authy production key" /> </appSettings>
-
Build the solution.
-
Run
Update-Database
at Package Manager Console to execute the migrations. -
Run the application.
-
Check it out at http://localhost:49217
That's it!
To let Authy OneTouch to use the callback endpoint you exposed, your development server will need to be publicly accessible. We recommend using ngrok to solve this problem.
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.