Giter Site home page Giter Site logo

account-security-csharp's Introduction

Twilio

Two-Factor Authentication with ASP.NET Core and Authy

Here you will learn how to create a login system for ASP.NET Core applications secured with 2FA using Authy.

Learn more about this code in our docs.

Quickstart

Create an Authy app

Enable Authy in your Twilio Account if you don't have one already, and then connect it to your Twilio account.

Local development

This project is built using Install .NET Core, which will need to be installed before continuing.

  1. First clone this repository and cd into it.

    git clone https://github.com/TwilioDevEd/account-security-csharp.git
    cd account-security-csharp 
  2. Install the dependencies.

    cd src/AccountSecurity
    dotnet restore 

MSSQL Server

You can either install it or run it in a docker container.

  • Install MSSQL Server Express

  • Run in a docker container:

    docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name mssql -d microsoft/mssql-server-linux:latest

  1. Make sure your DefaultConnection connection string is correct for your SQL Server installation. (You may need to change the Server to localhost\\SQLEXPRESS if running MSSQL Server Express on Windows.)

  2. Run the database migrations:

    dotnet ef database update -v
  3. Set your Authy App API Key in your appsettings.json as AuthyApiKey which should be found under your Authy App Settings.

  4. Run the server.

    dotnet run --environment development 
  5. Expose your application to the wider internet using ngrok. You can click here for more details. This step is important because the application won't work as expected if you run it through localhost.

    ngrok http 5000 

Once ngrok is running, open up your browser and go to your ngrok URL. It will look something like this: http://9a159ccf.ngrok.io

Meta

  • No warranty expressed or implied. Software is as is.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

account-security-csharp's People

Contributors

dprothero avatar joliveros avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.