You can see the welcome screen as shown in the image below.Ĭlick on “Begin”. We are using an Android device for this demo. It will allow you to scan this QR code in order to generate a Verification Code and complete two-factor authentication setup.ĭownload and install Google authenticator from the Play Store for Android and from the App Store for iOS. You need to install the Google Authenticator app on your smartphone. You can see a QR code generated on your screen - it is asking for a “Verification Code”, also as shown in the image below. You will see a page similar to that shown below.Ĭlick on the “Configure authenticator app” button. Select “TwoFactorAuthentication” from the left menu. Click on it to navigate to the “Manage your account” page. Here, you can see your registered Email id at the top right corner of the page. Upon successful registration, you will be logged into the application and navigated to the home page. Fill in the details and click on the “Register” button as shown in the image below. Press F5 to launch the application and click on “Register” in the top right corner of the homepage. This will update the database using Entity Framework Code First Migrations. Put in the “Update-Database” command and hit Enter. It will open the Package Manager Console. Navigate to Tools > NuGet Package Manager > Package Manager Console. Configure two-factor authenticationīefore running the application, we need to apply migrations to our app. Then you can set up two factor authentication using the Google authenticator with the help of this QR code. When we execute the program, a QR code will be generated in this View. You will find Scripts at the end of the file. Download the qrcode.js JavaScript library from and put it into the “Open the “Views\Manage\EnableAuthenticator.cshtml” file. We will be using a QR code to configure and sync the Google authenticator app with our web app. Adding QR Codes to configure two-factor authentication Now, click OK again to create your web app. Select “Individual User Account” and click OK. A “Change Authentication” dialog box will open. Then, select the “Web application (Model-View-Controller)” template. Select “.NET Core” and “ASP.NET Core 2.0” from these drop-downs. You can see two drop-down menus at the top left of the template window. Name the project “TwoFactAuth” and press OK.Īfter clicking OK, a new dialog will open asking you to select the project template. Then, select “ASP.NET Core Web Application” from the available project types. NET Core inside the Visual C# menu from the left panel. After selecting the project, a “New Project” dialog will open. Open Visual Studio and select File > New > Project. Install the latest version of Visual Studio 2017 Community Edition from here.īefore proceeding, I would recommend that you get the source code from GitHub Create the MVC Web Application.The key generated in the app will be unique to your userID, and is a time-based one-time password (TOTP) - that is, it will expire after a certain time. When you login to the web application, you have to enter a six-digit pin that will be generated in the app to finish the two-factor authentication. To use it, you need to configure the Google Authenticator app on your smartphone using the QR code generated in the web app. In this article, we are going to learn how to perform two-factor authentication in an ASP.NET Core application using the Google Authenticator app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |