diff options
author | glacasa <guillaumelacasa@hotmail.com> | 2013-06-13 20:43:33 +0200 |
---|---|---|
committer | glacasa <guillaumelacasa@hotmail.com> | 2013-06-13 20:43:33 +0200 |
commit | db2840622d085b1920a370f3452c9bd323a36414 (patch) | |
tree | 5c8db48b33495bd3498c9507a226157c4db213f1 | |
parent | ff46be4aa905588089b25b2cefe242eac0af7c6c (diff) | |
download | TwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.zip TwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.tar.gz TwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.tar.bz2 |
Update README.md
-rw-r--r-- | README.md | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -1,6 +1,30 @@ TwoStepsAuthenticator ===================== -.net implementation of the TOTP: Time-Based One-Time Password Algorithm - RFC 6238 http://tools.ietf.org/html/rfc6238 +.net implementation of the TOTP: Time-Based One-Time Password Algorithm<br/> +RFC 6238 http://tools.ietf.org/html/rfc6238 compatible with Microsoft Authenticator for Windows Phone, and Google Authenticator for Android and iPhone. + +You can use this library as well for a client application (if you want to create your own authenticator) or for a server application (add two-step authentication on your asp.net website) + +For a client application, you need to save the secret key for your user. <br/> +Then, you only have to call the method GetCode(string) : + +<pre><code>var secret = user.secretAuthToken; +var authenticator = new TwoStepsAuthenticator.Authenticator(); +var code = authenticator.GetCode(secret);</code></pre> + +On a server application, you will have to generate a secret key, and share it with the user, who will have to enter it in his own authenticator app. + +<pre><code>var authenticator = new TwoStepsAuthenticator.Authenticator(); +var key = authenticator.GenerateKey();</code></pre> + +When the user will login, he will have to give you the code generated by his authenticator.<br/> +You can check if the code is correct with the method CheckCode(string secret, string code).<br/> +If the code is incorrect, don't log him. + +<pre><code>var secret = user.secretAuthToken; +var code = Request.Form["code"]; +var authenticator = new TwoStepsAuthenticator.Authenticator(); +var isok = authenticator.CheckCode(secret, code);</code></pre> |