{"repo":"marcominerva/TwoFactorAuthenticationSample","free":true,"listed":false,"github":"https://github.com/marcominerva/TwoFactorAuthenticationSample","clone":"git clone https://github.com/marcominerva/TwoFactorAuthenticationSample.git","description":"A sample that showcases how to implement Two-Factor authentication in a Web API using an external Authenticator app","language":"C#","stars":22,"topics":["authentication","authenticator-app","csharp","minimal-api","qrcode","two-factor-authentication","visual-studio","web-api"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Two-Factor Authentication Sample A sample that showcases how to implement Two-Factor authentication in a Web API using an external Authenticator app. Setup - Open the appsettings.json file and set the connection string to the database - Run the application How it works - Call /api/auth/register to register a new user - Call /api/auth/login to get a user token (this is not the JWT and expires after 5 minutes) - Call /api/auth/qrcode?token={userToken} with the user token as query parameter to get the QR Code to add the account to the Authenticator app (note: the QR Code can be obtained only once, this is by design in this sample) - Call /api/auth/validate with the user token and the OTP code to get the actual JWT The built-in support for Two-Factor authentication in ASP.NET Core lacks some features. We may want to handle the other options that are provided by the RFC 6238, for example: - Getting the time step of OTP verification to check that the code has only been validated once - Defining the window of time steps that are considered acceptable for validation In this case, it is possible to take a look to Otp.Net and use it to implement the OTP verification.","default_branch":null,"files":null,"tree":[],"storefront":"/r/marcominerva","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/marcominerva/TwoFactorAuthenticationSample/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}