summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglacasa <guillaumelacasa@hotmail.com>2013-06-13 20:43:33 +0200
committerglacasa <guillaumelacasa@hotmail.com>2013-06-13 20:43:33 +0200
commitdb2840622d085b1920a370f3452c9bd323a36414 (patch)
tree5c8db48b33495bd3498c9507a226157c4db213f1
parentff46be4aa905588089b25b2cefe242eac0af7c6c (diff)
downloadTwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.zip
TwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.tar.gz
TwoStepsAuthenticator-db2840622d085b1920a370f3452c9bd323a36414.tar.bz2
Update README.md
-rw-r--r--README.md26
1 files changed, 25 insertions, 1 deletions
diff --git a/README.md b/README.md
index b8d244c..db96b7f 100644
--- a/README.md
+++ b/README.md
@@ -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>