13 lines
382 B
Python
13 lines
382 B
Python
import pyotp
|
|
import json
|
|
|
|
from django.http import HttpResponse
|
|
from django.conf import settings
|
|
|
|
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))
|