ungleich-otp/ungleichotpclient/README.md

29 lines
626 B
Markdown

## Run
Use your favorite uwsgi configuration or
```
UNGLEICHOTPSERVER=https://your-server-address/
UNGLEICHOTPREALM=admin \
UNGLEICHOTPNAME=sampleapp \
UNGLEICHOTPSEED=CEKXVG3235PO2HDW \
python manage.py runserver
```
This triple will be used to connect to the
## Use ##
curl
def index(request):
answer = {}
answer['token'] = pyotp.TOTP(settings.UNGLEICHOTP['UNGLEICHOTPSEED']).now()
answer['name'] = settings.UNGLEICHOTP['UNGLEICHOTPNAME']
answer['realm'] = settings.UNGLEICHOTP['UNGLEICHOTPREALM']
return HttpResponse(json.dumps(answer))
elif request.method == 'POST':
do_something_else()