I'm looking for a tutorial on how to use Google Authenticator in .NET-apps. Does this exist, and if so, where can I find it?
I understand that this can be used to add two-factor-authentication to your own apps.
I'm looking for a tutorial on how to use Google Authenticator in .NET-apps. Does this exist, and if so, where can I find it?
I understand that this can be used to add two-factor-authentication to your own apps.
While playing around with Google Authenticator, I came across this question and in particular the code contributed by Espo. I personally wasn't satisfied with the conversion from Java to C# and so I thought I would share my version. Aside from heavily refactoring the code:
For more information on the provisioning url format, see also: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
Feel free to use if you like, and thanks to Espo for the initial work.
To Add Google Two Factor Authentication using Google Authenticator you need the following
To get the Google.Authenticator; check here https://www.nuget.org/packages/GoogleAuthenticator
now setting up the Google authentication.
you can change the SuperSecretKeyGoesHere to any value that you want, but make sure it has more than 10 character otherwise the manual entry key that is generated will not work. Now you can check the user input with text box and button click
this bit will look at the user entry and see if its ok
The question asked for a tutorial which the other answers I don't feel cover,
one can be found at:
http://www.codeproject.com/Articles/403355/Implementing-Two-Factor-Authentication-in-ASP-NET
The tutorial was written by Rick Bassham and covers information on:
"What is Two Factor Authentication" "What is Google Authenticator" "How does it work"
It then explains how to implement code for:
"Counter Based One Time Password Generation" "Time Based One Time Password Generation"
And gives a full tutorial using Visual Studio 2010 under:
"How do I put it to use"
You could run this simple Console App to understand how to verify the one time token code. Note that we need to install library Otp.Net from Nuget package first.
I didn't find a tutorial, but it seems like writing a port wouldn't be so hard. It is a Java application, and is based off existing standards (HMAC SHA1).
See this page for details on the non-GUI guts:
And see these pages for info on porting, and an existing (unofficial) Silverlight port:
After a bit of researching and testing I created my own "proof-of-concept" on how to you can generate a QR-image, scan it from your phone, and then verify that the pin-code on the phone is correct. Maybe this could be developed further as a library if anyone wants to join? The code can be found here:
https://github.com/esp0/googleAuthNet