Search code examples
c#asp.netauthenticationmulti-factor-authentication

Is there still a Microsoft Authenticator dev API? How can I use It?


I don't know exactly if I should ask this question here, neither if I'm using the exact right tags, but... I need to add a 2FA to a system I'm developing and, while I was looking for the best available options of 2FA, we thought about adding Microsoft Authenticator support to it (We liked Authy, Google Authenticator, etc, but we tend to prefer Microsoft solutions here). It seems it used to exist a way of adding Microsoft's 2FA to our site, but is there a way to do it now in 2019? If so, is it free (We got Microsoft developer accounts... If having them is the only paid requirement, we're ok)


Solution

  • The Microsoft and Google Authenticators just implement the TOTP mechanism to provide a serverless (read: offline, you only need an accurate timestamp) one time password mechanism. You can use any generic TOTP library to generate a user specific shared secret, possibly encode that one as QR image for ease of configuration and then validate if a provided token matches the shared secret and has been created in the last +-n seconds.