Multi-Factor Authentication Design with IdentityServer4 and ASP.NET Core 2.0 (1)

xenirio
2 min readNov 17, 2018

--

Chapter 1

Currently, Almost of login system verify an account not just username/password also including with OTP through SMS as well as normal login is not safe anymore ..

ASP.NET / IdentityServer4 has built-in MFA, or in the case of above is 2FA. This article will introduce how to design and implement own MFA without build-in of ASP.NET / IdentityServer4.

The challenges are …

  1. Make RESTful Authentication
  2. No UI in Identity Server for Authentication.
  3. Stateless Authentication based on JWT.
  4. Enrollment process is unlimited. (2FA takes 2 steps)
  5. Each part can verify individually.
  6. All parts need to work together as steps of verification.

The challenges can be group into 3 groups

  1. Apply Extension Grants which is once of Grant Types of Identity Server as authentication.
  2. Apply JWT to be a Stateless Token between Client-Server, then set expiry time in each verification step.
  3. It is important to create a Verification Unit to work on it, and then release the Claims as output and forward to next Verification Unit to operate continuously. Put them together (Wired) as a pipeline using the Identifier. Finally, make the Secret and Hashing.

--

--