summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2016-07-22 17:53:37 +0300
committerYuval Adam <_@yuv.al>2016-07-22 17:53:37 +0300
commitbc499a3628d3b5a246c36504998f2f9ce8fb2639 (patch)
tree23c0d40052dd3729efc5288977d45fda9273f42d /README.md
parent814f1e7b61fb7ee7e0ebbff18d7a1ec9d0485e1c (diff)
Add theoretically-correct test vector instructions in README
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 2836919..bb688b1 100644
--- a/README.md
+++ b/README.md
@@ -10,3 +10,27 @@ The usual:
$ pip install -r requirements.txt
$ python manage.py migrate
```
+
+Create an admin superuser:
+
+```bash
+$ python manage.py createsuperuser
+```
+
+Open a shell:
+
+```bash
+$ python manage.py shell
+```
+
+Then create a device for your user using one of the published [test vectors](https://developers.yubico.com/OTP/Test_Vectors.html):
+
+```python
+>>> from django.contrib.auth import get_user_model
+>>> user = get_user_model().objects.get(username='admin')
+>>> device = user.yubikeydevice_set.create(key='000102030405060708090a0b0c0d0e0f', private_id='010203040506', session=0, counter=0)
+>>> device.public_id()
+b'cccccccb' # note the modhex encoded public id of the primary key (1)
+```
+
+You should now be able to log in to http://127.0.0.1:8000/admin/login/ using user `admin`, password `password` and the OTP token `cccccccbdvgtiblfkbgturecfllberrvkinnctnn`