Compare commits
1 Commits
master
...
MoreOption
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ddef51eaa |
@@ -1,12 +1,4 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
## 2.8.0
|
|
||||||
* Support For Django 4.0+ JSONField
|
|
||||||
* Removed jsonfield package from requirements
|
|
||||||
|
|
||||||
## 2.7.0
|
|
||||||
* Fixed #70
|
|
||||||
* Add QR Code for trusted device link
|
|
||||||
* Better formatting for trusted device start page.
|
|
||||||
## 2.6.1
|
## 2.6.1
|
||||||
* Fix: CVE-2022-42731: related to the possibility of registration replay attack.
|
* Fix: CVE-2022-42731: related to the possibility of registration replay attack.
|
||||||
Thanks to 'SSE (Secure Systems Engineering)'
|
Thanks to 'SSE (Secure Systems Engineering)'
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -22,9 +22,7 @@ For FIDO2, the following are supported
|
|||||||
* **android-safetynet** (Chrome 70+, Firefox 68+)
|
* **android-safetynet** (Chrome 70+, Firefox 68+)
|
||||||
* **NFC devices using PCSC** (Not Tested, but as supported in fido2)
|
* **NFC devices using PCSC** (Not Tested, but as supported in fido2)
|
||||||
* **Soft Tokens**
|
* **Soft Tokens**
|
||||||
* ~~[krypt.co](https://krypt.co/): Login by a notification on your phone.~~
|
* [krypt.co](https://krypt.co/): Login by a notification on your phone.
|
||||||
|
|
||||||
**Update**: Dec 2022, krypt.co has been killed by Google for Passkeys.
|
|
||||||
|
|
||||||
In English :), It allows you to verify the user by security keys on PC, Laptops or Mobiles, Windows Hello (Fingerprint, PIN) on Windows 10 Build 1903+ (May 2019 Update) Touch/Face ID on Macbooks (Chrome, Safari), Touch/Face ID on iPhone and iPad and Fingerprint/Face/Iris/PIN on Android Phones.
|
In English :), It allows you to verify the user by security keys on PC, Laptops or Mobiles, Windows Hello (Fingerprint, PIN) on Windows 10 Build 1903+ (May 2019 Update) Touch/Face ID on Macbooks (Chrome, Safari), Touch/Face ID on iPhone and iPad and Fingerprint/Face/Iris/PIN on Android Phones.
|
||||||
|
|
||||||
@@ -34,8 +32,6 @@ Trusted device is a mode for the user to add a device that doesn't support secur
|
|||||||
|
|
||||||
Package tested with Django 1.8, Django 2.2 on Python 2.7 and Python 3.5+ but it was not checked with any version in between but open for issues.
|
Package tested with Django 1.8, Django 2.2 on Python 2.7 and Python 3.5+ but it was not checked with any version in between but open for issues.
|
||||||
|
|
||||||
If you just need WebAuthn and Passkeys, you can use **[django-passkeys](https://github.com/mkalioby/django-passkeys)**, which is a slim-down of this app and much easier to integrate.
|
|
||||||
|
|
||||||
Depends on
|
Depends on
|
||||||
|
|
||||||
* pyotp
|
* pyotp
|
||||||
@@ -47,12 +43,8 @@ Depends on
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
1. using pip
|
1. using pip
|
||||||
* For Django >= 4.0
|
|
||||||
|
|
||||||
`pip install django-mfa2`
|
`pip install django-mfa2`
|
||||||
* For Django < 4.0
|
|
||||||
|
|
||||||
`pip install django-mfa2 jsonfield`
|
|
||||||
2. Using Conda forge
|
2. Using Conda forge
|
||||||
|
|
||||||
`conda config --add channels conda-forge`
|
`conda config --add channels conda-forge`
|
||||||
@@ -98,6 +90,10 @@ Depends on
|
|||||||
U2F_APPID="https://localhost" #URL For U2F
|
U2F_APPID="https://localhost" #URL For U2F
|
||||||
FIDO_SERVER_ID=u"localehost" # Server rp id for FIDO2, it is the full domain of your project
|
FIDO_SERVER_ID=u"localehost" # Server rp id for FIDO2, it is the full domain of your project
|
||||||
FIDO_SERVER_NAME=u"PROJECT_NAME"
|
FIDO_SERVER_NAME=u"PROJECT_NAME"
|
||||||
|
MFA_FIDO2_RESIDENT_KEY = mfa.ResidentKey.DISCOURAGED # Resident Key allows a special User Handle
|
||||||
|
MFA_FIDO2_AUTHENTICATOR_ATTACHMENT = None # Let the user choose
|
||||||
|
MFA_FIDO2_USER_VERIFICATION = None # Verify User Presence
|
||||||
|
MFA_FIDO2_ATTESTATION_PREFERENCE = mfa.AttestationPreference.NONE
|
||||||
```
|
```
|
||||||
**Method Names**
|
**Method Names**
|
||||||
* U2F
|
* U2F
|
||||||
@@ -112,8 +108,10 @@ Depends on
|
|||||||
* Starting version 1.7.0, Key owners can be specified.
|
* Starting version 1.7.0, Key owners can be specified.
|
||||||
* Starting version 2.2.0
|
* Starting version 2.2.0
|
||||||
* Added: `MFA_SUCCESS_REGISTRATION_MSG` & `MFA_REDIRECT_AFTER_REGISTRATION`
|
* Added: `MFA_SUCCESS_REGISTRATION_MSG` & `MFA_REDIRECT_AFTER_REGISTRATION`
|
||||||
Start version 2.6.0
|
* Starting version 2.6.0
|
||||||
* Added: `MFA_ALWAYS_GO_TO_LAST_METHOD`, `MFA_RENAME_METHODS`, `MFA_ENFORCE_RECOVERY_METHOD` & `RECOVERY_ITERATION`
|
* Added: `MFA_ALWAYS_GO_TO_LAST_METHOD`, `MFA_RENAME_METHODS`, `MFA_ENFORCE_RECOVERY_METHOD` & `RECOVERY_ITERATION`
|
||||||
|
* Starting version 2.7.0
|
||||||
|
* Added: `MFA_FIDO2_RESIDENT_KEY`, `MFA_FIDO2_AUTHENTICATOR_ATTACHMENT`, `MFA_FIDO2_USER_VERIFICATION`, `MFA_FIDO2_ATTESTATION_PREFERENCE`
|
||||||
4. Break your login function
|
4. Break your login function
|
||||||
|
|
||||||
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
|||||||
import os
|
import os
|
||||||
from django.conf.global_settings import PASSWORD_HASHERS as DEFAULT_PASSWORD_HASHERS
|
from django.conf.global_settings import PASSWORD_HASHERS as DEFAULT_PASSWORD_HASHERS
|
||||||
|
|
||||||
|
import mfa
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
@@ -145,6 +147,10 @@ MFA_REDIRECT_AFTER_REGISTRATION="registered"
|
|||||||
MFA_SUCCESS_REGISTRATION_MSG="Go to Home"
|
MFA_SUCCESS_REGISTRATION_MSG="Go to Home"
|
||||||
MFA_ALWAYS_GO_TO_LAST_METHOD = True
|
MFA_ALWAYS_GO_TO_LAST_METHOD = True
|
||||||
MFA_ENFORCE_RECOVERY_METHOD = True
|
MFA_ENFORCE_RECOVERY_METHOD = True
|
||||||
|
MFA_FIDO2_RESIDENT_KEY = mfa.ResidentKey.REQUIRED # Resident Key allows a special User Handle
|
||||||
|
MFA_FIDO2_AUTHENTICATOR_ATTACHMENT = None # Let the user choose
|
||||||
|
MFA_FIDO2_USER_VERIFICATION = None # Verify User Presence
|
||||||
|
MFA_FIDO2_ATTESTATION_PREFERENCE = mfa.AttestationPreference.NONE
|
||||||
MFA_RENAME_METHODS = {"RECOVERY":"Backup Codes","FIDO2":"Biometric Authentication"}
|
MFA_RENAME_METHODS = {"RECOVERY":"Backup Codes","FIDO2":"Biometric Authentication"}
|
||||||
PASSWORD_HASHERS = DEFAULT_PASSWORD_HASHERS #Comment if PASSWORD_HASHER already set
|
PASSWORD_HASHERS = DEFAULT_PASSWORD_HASHERS #Comment if PASSWORD_HASHER already set
|
||||||
PASSWORD_HASHERS += ['mfa.recovery.Hash']
|
PASSWORD_HASHERS += ['mfa.recovery.Hash']
|
||||||
|
|||||||
@@ -44,7 +44,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-primary btn-block" type="submit">Login</button>
|
<button class="btn btn-primary btn-block" type="submit">Login</button><br/>
|
||||||
|
|
||||||
|
<button class="btn btn-primary btn-block" type="button" onclick="authen()">Login By Security Key</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,7 +58,7 @@
|
|||||||
|
|
||||||
<!-- Core plugin JavaScript-->
|
<!-- Core plugin JavaScript-->
|
||||||
<script src="{% static 'vendor/jquery-easing/jquery.easing.min.js'%}"></script>
|
<script src="{% static 'vendor/jquery-easing/jquery.easing.min.js'%}"></script>
|
||||||
|
{% include 'FIDO2/Auth_JS.html'%}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ Including another URLconf
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path,re_path,include
|
from django.urls import path,re_path,include
|
||||||
from . import views,auth
|
from . import views,auth
|
||||||
from mfa import TrustedDevice
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('mfa/', include('mfa.urls')),
|
path('mfa/', include('mfa.urls')),
|
||||||
path('auth/login',auth.loginView,name="login"),
|
path('auth/login',auth.loginView,name="login"),
|
||||||
path('auth/logout',auth.logoutView,name="logout"),
|
path('auth/logout',auth.logoutView,name="logout"),
|
||||||
path('devices/add/', TrustedDevice.add,name="add_trusted_device"),
|
|
||||||
re_path('^$',views.home,name='home'),
|
re_path('^$',views.home,name='home'),
|
||||||
path('registered/',views.registered,name='registered')
|
path('registered/',views.registered,name='registered')
|
||||||
]
|
]
|
||||||
|
|||||||
38
mfa/FIDO2.py
38
mfa/FIDO2.py
@@ -28,18 +28,25 @@ def recheck(request):
|
|||||||
|
|
||||||
def getServer():
|
def getServer():
|
||||||
"""Get Server Info from settings and returns a Fido2Server"""
|
"""Get Server Info from settings and returns a Fido2Server"""
|
||||||
|
from mfa import AttestationPreference
|
||||||
rp = PublicKeyCredentialRpEntity(id=settings.FIDO_SERVER_ID, name=settings.FIDO_SERVER_NAME)
|
rp = PublicKeyCredentialRpEntity(id=settings.FIDO_SERVER_ID, name=settings.FIDO_SERVER_NAME)
|
||||||
return Fido2Server(rp)
|
attestation= getattr(settings,'MFA_FIDO2_ATTESTATION_PREFERENCE', AttestationPreference.NONE )
|
||||||
|
return Fido2Server(rp,attestation=attestation)
|
||||||
|
|
||||||
|
|
||||||
def begin_registeration(request):
|
def begin_registeration(request):
|
||||||
"""Starts registering a new FIDO Device, called from API"""
|
"""Starts registering a new FIDO Device, called from API"""
|
||||||
server = getServer()
|
server = getServer()
|
||||||
|
from mfa import ResidentKey
|
||||||
|
resident_key = getattr(settings,'MFA_FIDO2_RESIDENT_KEY', ResidentKey.DISCOURAGED)
|
||||||
|
auth_attachment = getattr(settings,'MFA_FIDO2_AUTHENTICATOR_ATTACHMENT', None)
|
||||||
|
user_verification = getattr(settings,'MFA_FIDO2_USER_VERIFICATION', None)
|
||||||
registration_data, state = server.register_begin({
|
registration_data, state = server.register_begin({
|
||||||
u'id': request.user.username.encode("utf8"),
|
u'id': request.user.username.encode("utf8"),
|
||||||
u'name': (request.user.first_name + " " + request.user.last_name),
|
u'name': (request.user.first_name + " " + request.user.last_name),
|
||||||
u'displayName': request.user.username,
|
u'displayName': request.user.username,
|
||||||
}, getUserCredentials(request.user.username))
|
}, getUserCredentials(request.user.username),user_verification = user_verification,
|
||||||
|
resident_key_requirement = resident_key, authenticator_attachment = auth_attachment)
|
||||||
request.session['fido_state'] = state
|
request.session['fido_state'] = state
|
||||||
|
|
||||||
return HttpResponse(cbor.encode(registration_data), content_type = 'application/octet-stream')
|
return HttpResponse(cbor.encode(registration_data), content_type = 'application/octet-stream')
|
||||||
@@ -67,6 +74,8 @@ def complete_reg(request):
|
|||||||
uk.properties = {"device": encoded, "type": att_obj.fmt, }
|
uk.properties = {"device": encoded, "type": att_obj.fmt, }
|
||||||
uk.owned_by_enterprise = getattr(settings, "MFA_OWNED_BY_ENTERPRISE", False)
|
uk.owned_by_enterprise = getattr(settings, "MFA_OWNED_BY_ENTERPRISE", False)
|
||||||
uk.key_type = "FIDO2"
|
uk.key_type = "FIDO2"
|
||||||
|
if auth_data.credential_data.credential_id:
|
||||||
|
uk.user_handle = auth_data.credential_data.credential_id
|
||||||
uk.save()
|
uk.save()
|
||||||
if getattr(settings, 'MFA_ENFORCE_RECOVERY_METHOD', False) and not User_Keys.objects.filter(key_type = "RECOVERY", username=request.user.username).exists():
|
if getattr(settings, 'MFA_ENFORCE_RECOVERY_METHOD', False) and not User_Keys.objects.filter(key_type = "RECOVERY", username=request.user.username).exists():
|
||||||
request.session["mfa_reg"] = {"method":"FIDO2","name": getattr(settings, "MFA_RENAME_METHODS", {}).get("FIDO2", "FIDO2")}
|
request.session["mfa_reg"] = {"method":"FIDO2","name": getattr(settings, "MFA_RENAME_METHODS", {}).get("FIDO2", "FIDO2")}
|
||||||
@@ -107,6 +116,13 @@ def auth(request):
|
|||||||
|
|
||||||
def authenticate_begin(request):
|
def authenticate_begin(request):
|
||||||
server = getServer()
|
server = getServer()
|
||||||
|
credentials=[]
|
||||||
|
username = None
|
||||||
|
if "base_username" in request.session:
|
||||||
|
username = request.session["base_username"]
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
username = request.user.username
|
||||||
|
if username:
|
||||||
credentials = getUserCredentials(request.session.get("base_username", request.user.username))
|
credentials = getUserCredentials(request.session.get("base_username", request.user.username))
|
||||||
auth_data, state = server.authenticate_begin(credentials)
|
auth_data, state = server.authenticate_begin(credentials)
|
||||||
request.session['fido_state'] = state
|
request.session['fido_state'] = state
|
||||||
@@ -117,11 +133,22 @@ def authenticate_begin(request):
|
|||||||
def authenticate_complete(request):
|
def authenticate_complete(request):
|
||||||
try:
|
try:
|
||||||
credentials = []
|
credentials = []
|
||||||
username = request.session.get("base_username", request.user.username)
|
username = None
|
||||||
|
keys = None
|
||||||
|
if "base_username" in request.session:
|
||||||
|
username = request.session["base_username"]
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
username = request.user.username
|
||||||
server = getServer()
|
server = getServer()
|
||||||
credentials = getUserCredentials(username)
|
|
||||||
data = cbor.decode(request.body)
|
data = cbor.decode(request.body)
|
||||||
credential_id = data['credentialId']
|
credential_id = data['credentialId']
|
||||||
|
if credential_id and username is None:
|
||||||
|
keys = User_Keys.objects.filter(user_handle = credential_id)
|
||||||
|
if keys.exists():
|
||||||
|
credentials=[AttestedCredentialData(websafe_decode(keys[0].properties["device"]))]
|
||||||
|
else:
|
||||||
|
credentials = getUserCredentials(username)
|
||||||
|
|
||||||
client_data = CollectedClientData(data['clientDataJSON'])
|
client_data = CollectedClientData(data['clientDataJSON'])
|
||||||
auth_data = AuthenticatorData(data['authenticatorData'])
|
auth_data = AuthenticatorData(data['authenticatorData'])
|
||||||
signature = data['signature']
|
signature = data['signature']
|
||||||
@@ -155,6 +182,7 @@ def authenticate_complete(request):
|
|||||||
content_type = "application/json")
|
content_type = "application/json")
|
||||||
else:
|
else:
|
||||||
import random
|
import random
|
||||||
|
if keys is None:
|
||||||
keys = User_Keys.objects.filter(username = username, key_type = "FIDO2", enabled = 1)
|
keys = User_Keys.objects.filter(username = username, key_type = "FIDO2", enabled = 1)
|
||||||
for k in keys:
|
for k in keys:
|
||||||
if AttestedCredentialData(websafe_decode(k.properties["device"])).credential_id == cred.credential_id:
|
if AttestedCredentialData(websafe_decode(k.properties["device"])).credential_id == cred.credential_id:
|
||||||
@@ -170,7 +198,7 @@ def authenticate_complete(request):
|
|||||||
except:
|
except:
|
||||||
authenticated = request.user.is_authenticated()
|
authenticated = request.user.is_authenticated()
|
||||||
if not authenticated:
|
if not authenticated:
|
||||||
res = login(request)
|
res = login(request,k.username)
|
||||||
if not "location" in res: return reset_cookie(request)
|
if not "location" in res: return reset_cookie(request)
|
||||||
return HttpResponse(simplejson.dumps({'status': "OK", "redirect": res["location"]}),
|
return HttpResponse(simplejson.dumps({'status': "OK", "redirect": res["location"]}),
|
||||||
content_type = "application/json")
|
content_type = "application/json")
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ from django.template.context_processors import csrf
|
|||||||
from .models import *
|
from .models import *
|
||||||
import user_agents
|
import user_agents
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
|
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
|
||||||
x=''.join(random.choice(chars) for _ in range(size))
|
x=''.join(random.choice(chars) for _ in range(size))
|
||||||
if not User_Keys.objects.filter(properties__icontains='"key": "%s"'%x).exists(): return x
|
if not User_Keys.objects.filter(properties__shas="$.key="+x).exists(): return x
|
||||||
else: return id_generator(size,chars)
|
else: return id_generator(size,chars)
|
||||||
|
|
||||||
def getUserAgent(request):
|
def getUserAgent(request):
|
||||||
@@ -58,13 +57,12 @@ def getCookie(request):
|
|||||||
def add(request):
|
def add(request):
|
||||||
context=csrf(request)
|
context=csrf(request)
|
||||||
if request.method=="GET":
|
if request.method=="GET":
|
||||||
context.update({"username":request.GET.get('u',''),"key":request.GET.get('k','')})
|
|
||||||
return render(request,"TrustedDevices/Add.html",context)
|
return render(request,"TrustedDevices/Add.html",context)
|
||||||
else:
|
else:
|
||||||
key=request.POST["key"].replace("-","").replace(" ","").upper()
|
key=request.POST["key"].replace("-","").replace(" ","").upper()
|
||||||
context["username"] = request.POST["username"]
|
context["username"] = request.POST["username"]
|
||||||
context["key"] = request.POST["key"]
|
context["key"] = request.POST["key"]
|
||||||
trusted_keys=User_Keys.objects.filter(username=request.POST["username"],properties__icontains='"key": "%s"'%key)
|
trusted_keys=User_Keys.objects.filter(username=request.POST["username"],properties__has="$.key="+key)
|
||||||
cookie=False
|
cookie=False
|
||||||
if trusted_keys.exists():
|
if trusted_keys.exists():
|
||||||
tk=trusted_keys[0]
|
tk=trusted_keys[0]
|
||||||
@@ -99,7 +97,7 @@ def start(request):
|
|||||||
request.session["td_id"]=td.id
|
request.session["td_id"]=td.id
|
||||||
try:
|
try:
|
||||||
if td==None: td=User_Keys.objects.get(id=request.session["td_id"])
|
if td==None: td=User_Keys.objects.get(id=request.session["td_id"])
|
||||||
context={"key":td.properties["key"],"url":request.scheme+"://"+request.get_host() + reverse('add_trusted_device')}
|
context={"key":td.properties["key"]}
|
||||||
except:
|
except:
|
||||||
del request.session["td_id"]
|
del request.session["td_id"]
|
||||||
return start(request)
|
return start(request)
|
||||||
@@ -126,14 +124,12 @@ def verify(request):
|
|||||||
json= jwt.decode(request.COOKIES.get('deviceid'),settings.SECRET_KEY)
|
json= jwt.decode(request.COOKIES.get('deviceid'),settings.SECRET_KEY)
|
||||||
if json["username"].lower()== request.session['base_username'].lower():
|
if json["username"].lower()== request.session['base_username'].lower():
|
||||||
try:
|
try:
|
||||||
uk = User_Keys.objects.get(username=request.POST["username"].lower(), properties__icontains='"key": "%s"'%json["key"])
|
uk = User_Keys.objects.get(username=request.POST["username"].lower(), properties__has="$.key=" + json["key"])
|
||||||
if uk.enabled and uk.properties["status"] == "trusted":
|
if uk.enabled and uk.properties["status"] == "trusted":
|
||||||
uk.last_used=timezone.now()
|
uk.last_used=timezone.now()
|
||||||
uk.save()
|
uk.save()
|
||||||
request.session["mfa"] = {"verified": True, "method": "Trusted Device","id":uk.id}
|
request.session["mfa"] = {"verified": True, "method": "Trusted Device","id":uk.id}
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
import traceback
|
|
||||||
print(traceback.format_exc())
|
|
||||||
return False
|
return False
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
__version__="2.2.0"
|
__version__="2.7.1"
|
||||||
|
from fido2.webauthn import ResidentKeyRequirement as ResidentKey
|
||||||
|
from fido2.webauthn import AuthenticatorAttachment as Attachment
|
||||||
|
from fido2.webauthn import UserVerificationRequirement as UserVerification
|
||||||
|
from fido2.webauthn import AttestationConveyancePreference as AttestationPreference
|
||||||
@@ -4,14 +4,8 @@ from . import TrustedDevice, U2F, FIDO2, totp
|
|||||||
import simplejson
|
import simplejson
|
||||||
from django.shortcuts import HttpResponse
|
from django.shortcuts import HttpResponse
|
||||||
from mfa.views import verify,goto
|
from mfa.views import verify,goto
|
||||||
from mfa.recovery import delTokens
|
|
||||||
def has_mfa(request,username):
|
def has_mfa(request,username):
|
||||||
uk = User_Keys.objects.filter(username=username,enabled=1)
|
if User_Keys.objects.filter(username=username,enabled=1).count()>0:
|
||||||
if uk.count()==1:
|
|
||||||
for u in uk:
|
|
||||||
if u.key_type == "RECOVERY":
|
|
||||||
delTokens(request)
|
|
||||||
elif uk.count()>0:
|
|
||||||
return verify(request, username)
|
return verify(request, username)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
try:
|
import jsonfield.fields
|
||||||
from django.db.models import JSONField
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from jsonfield.fields import JSONField
|
|
||||||
except ImportError:
|
|
||||||
raise ImportError("Can't find a JSONField implementation, please install jsonfield if django < 4.0")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def modify_json(apps, schema_editor):
|
def modify_json(apps, schema_editor):
|
||||||
@@ -31,7 +24,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user_keys',
|
model_name='user_keys',
|
||||||
name='properties',
|
name='properties',
|
||||||
field=JSONField(null=True),
|
field=jsonfield.fields.JSONField(null=True),
|
||||||
),
|
),
|
||||||
migrations.RunPython(modify_json)
|
migrations.RunPython(modify_json)
|
||||||
]
|
]
|
||||||
|
|||||||
17
mfa/migrations/0012_user_keys_userhandle.py
Normal file
17
mfa/migrations/0012_user_keys_userhandle.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 2.2 on 2022-10-16 14:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mfa', '0011_auto_20210530_0622'),
|
||||||
|
]
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='user_keys',
|
||||||
|
name='user_handle',
|
||||||
|
field=models.CharField(blank=True, default=None, max_length=255, null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,12 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
try:
|
from jsonfield import JSONField
|
||||||
from django.db.models import JSONField
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
try:
|
|
||||||
from jsonfield import JSONField
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
raise ModuleNotFoundError("Can't find a JSONField implementation, please install jsonfield if django < 4.0")
|
|
||||||
|
|
||||||
from jose import jwt
|
from jose import jwt
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
#from jsonLookup import shasLookup, hasLookup
|
#from jsonLookup import shasLookup, hasLookup
|
||||||
@@ -23,6 +16,7 @@ class User_Keys(models.Model):
|
|||||||
expires=models.DateTimeField(null=True,default=None,blank=True)
|
expires=models.DateTimeField(null=True,default=None,blank=True)
|
||||||
last_used=models.DateTimeField(null=True,default=None,blank=True)
|
last_used=models.DateTimeField(null=True,default=None,blank=True)
|
||||||
owned_by_enterprise=models.BooleanField(default=None,null=True,blank=True)
|
owned_by_enterprise=models.BooleanField(default=None,null=True,blank=True)
|
||||||
|
user_handle = models.CharField(default = None, null = True, blank = True, max_length = 255)
|
||||||
|
|
||||||
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
|
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
|
||||||
if self.key_type == "Trusted Device" and self.properties.get("signature","") == "":
|
if self.key_type == "Trusted Device" and self.properties.get("signature","") == "":
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"bootstrap-toggle.min.js","sources":["bootstrap-toggle.js"],"names":["$","Plugin","option","this","each","$this","data","options","Toggle","element","$element","extend","defaults","render","VERSION","DEFAULTS","on","off","onstyle","offstyle","size","style","width","height","prototype","attr","_onstyle","_offstyle","$toggleOn","html","addClass","$toggleOff","$toggleHandle","$toggleGroup","append","$toggle","prop","wrap","parent","Math","max","outerWidth","outerHeight","css","update","trigger","toggle","silent","removeClass","enable","removeAttr","disable","change","proxy","destroy","remove","removeData","unwrap","old","fn","bootstrapToggle","Constructor","noConflict","document","e","$checkbox","find","preventDefault","jQuery"],"mappings":";;;;;;;CASE,SAAUA,GACV,YAoID,SAASC,GAAOC,GACf,MAAOC,MAAKC,KAAK,WAChB,GAAIC,GAAUL,EAAEG,MACZG,EAAUD,EAAMC,KAAK,aACrBC,EAA2B,gBAAVL,IAAsBA,CAEtCI,IAAMD,EAAMC,KAAK,YAAcA,EAAO,GAAIE,GAAOL,KAAMI,IACvC,gBAAVL,IAAsBI,EAAKJ,IAASI,EAAKJ,OAtItD,GAAIM,GAAS,SAAUC,EAASF,GAC/BJ,KAAKO,SAAYV,EAAES,GACnBN,KAAKI,QAAYP,EAAEW,UAAWR,KAAKS,WAAYL,GAC/CJ,KAAKU,SAGNL,GAAOM,QAAW,QAElBN,EAAOO,UACNC,GAAI,KACJC,IAAK,MACLC,QAAS,UACTC,SAAU,UACVC,KAAM,SACNC,MAAO,GACPC,MAAO,KACPC,OAAQ,MAGTf,EAAOgB,UAAUZ,SAAW,WAC3B,OACCI,GAAIb,KAAKO,SAASe,KAAK,YAAcjB,EAAOO,SAASC,GACrDC,IAAKd,KAAKO,SAASe,KAAK,aAAejB,EAAOO,SAASE,IACvDC,QAASf,KAAKO,SAASe,KAAK,iBAAmBjB,EAAOO,SAASG,QAC/DC,SAAUhB,KAAKO,SAASe,KAAK,kBAAoBjB,EAAOO,SAASI,SACjEC,KAAMjB,KAAKO,SAASe,KAAK,cAAgBjB,EAAOO,SAASK,KACzDC,MAAOlB,KAAKO,SAASe,KAAK,eAAiBjB,EAAOO,SAASM,MAC3DC,MAAOnB,KAAKO,SAASe,KAAK,eAAiBjB,EAAOO,SAASO,MAC3DC,OAAQpB,KAAKO,SAASe,KAAK,gBAAkBjB,EAAOO,SAASQ,SAI/Df,EAAOgB,UAAUX,OAAS,WACzBV,KAAKuB,SAAW,OAASvB,KAAKI,QAAQW,QACtCf,KAAKwB,UAAY,OAASxB,KAAKI,QAAQY,QACvC,IAAIC,GAA6B,UAAtBjB,KAAKI,QAAQa,KAAmB,SAClB,UAAtBjB,KAAKI,QAAQa,KAAmB,SACV,SAAtBjB,KAAKI,QAAQa,KAAkB,SAC/B,GACCQ,EAAY5B,EAAE,uBAAuB6B,KAAK1B,KAAKI,QAAQS,IACzDc,SAAS3B,KAAKuB,SAAW,IAAMN,GAC7BW,EAAa/B,EAAE,uBAAuB6B,KAAK1B,KAAKI,QAAQU,KAC1Da,SAAS3B,KAAKwB,UAAY,IAAMP,EAAO,WACrCY,EAAgBhC,EAAE,gDACpB8B,SAASV,GACPa,EAAejC,EAAE,8BACnBkC,OAAON,EAAWG,EAAYC,GAC5BG,EAAUnC,EAAE,iDACd8B,SAAU3B,KAAKO,SAAS0B,KAAK,WAAajC,KAAKuB,SAAWvB,KAAKwB,UAAU,QACzEG,SAASV,GAAMU,SAAS3B,KAAKI,QAAQc,MAEvClB,MAAKO,SAAS2B,KAAKF,GACnBnC,EAAEW,OAAOR,MACRgC,QAAShC,KAAKO,SAAS4B,SACvBV,UAAWA,EACXG,WAAYA,EACZE,aAAcA,IAEf9B,KAAKgC,QAAQD,OAAOD,EAEpB,IAAIX,GAAQnB,KAAKI,QAAQe,OAASiB,KAAKC,IAAIZ,EAAUa,aAAcV,EAAWU,cAAeT,EAAcS,aAAa,EACpHlB,EAASpB,KAAKI,QAAQgB,QAAUgB,KAAKC,IAAIZ,EAAUc,cAAeX,EAAWW,cACjFd,GAAUE,SAAS,aACnBC,EAAWD,SAAS,cACpB3B,KAAKgC,QAAQQ,KAAMrB,MAAOA,EAAOC,OAAQA,IACrCpB,KAAKI,QAAQgB,SAChBK,EAAUe,IAAI,cAAef,EAAUL,SAAW,MAClDQ,EAAWY,IAAI,cAAeZ,EAAWR,SAAW,OAErDpB,KAAKyC,QAAO,GACZzC,KAAK0C,SAAQ,IAGdrC,EAAOgB,UAAUsB,OAAS,WACrB3C,KAAKO,SAAS0B,KAAK,WAAYjC,KAAKc,MACnCd,KAAKa,MAGXR,EAAOgB,UAAUR,GAAK,SAAU+B,GAC/B,MAAI5C,MAAKO,SAAS0B,KAAK,aAAoB,GAC3CjC,KAAKgC,QAAQa,YAAY7C,KAAKwB,UAAY,QAAQG,SAAS3B,KAAKuB,UAChEvB,KAAKO,SAAS0B,KAAK,WAAW,QACzBW,GAAQ5C,KAAK0C,aAGnBrC,EAAOgB,UAAUP,IAAM,SAAU8B,GAChC,MAAI5C,MAAKO,SAAS0B,KAAK,aAAoB,GAC3CjC,KAAKgC,QAAQa,YAAY7C,KAAKuB,UAAUI,SAAS3B,KAAKwB,UAAY,QAClExB,KAAKO,SAAS0B,KAAK,WAAW,QACzBW,GAAQ5C,KAAK0C,aAGnBrC,EAAOgB,UAAUyB,OAAS,WACzB9C,KAAKgC,QAAQe,WAAW,YACxB/C,KAAKO,SAAS0B,KAAK,YAAY,IAGhC5B,EAAOgB,UAAU2B,QAAU,WAC1BhD,KAAKgC,QAAQV,KAAK,WAAY,YAC9BtB,KAAKO,SAAS0B,KAAK,YAAY,IAGhC5B,EAAOgB,UAAUoB,OAAS,SAAUG,GAC/B5C,KAAKO,SAAS0B,KAAK,YAAajC,KAAKgD,UACpChD,KAAK8C,SACN9C,KAAKO,SAAS0B,KAAK,WAAYjC,KAAKa,GAAG+B,GACtC5C,KAAKc,IAAI8B,IAGfvC,EAAOgB,UAAUqB,QAAU,SAAUE,GACpC5C,KAAKO,SAASO,IAAI,oBACb8B,GAAQ5C,KAAKO,SAAS0C,SAC3BjD,KAAKO,SAASM,GAAG,mBAAoBhB,EAAEqD,MAAM,WAC5ClD,KAAKyC,UACHzC,QAGJK,EAAOgB,UAAU8B,QAAU,WAC1BnD,KAAKO,SAASO,IAAI,oBAClBd,KAAK8B,aAAasB,SAClBpD,KAAKO,SAAS8C,WAAW,aACzBrD,KAAKO,SAAS+C,SAiBf,IAAIC,GAAM1D,EAAE2D,GAAGC,eAEf5D,GAAE2D,GAAGC,gBAA8B3D,EACnCD,EAAE2D,GAAGC,gBAAgBC,YAAcrD,EAKnCR,EAAE2D,GAAGb,OAAOgB,WAAa,WAExB,MADA9D,GAAE2D,GAAGC,gBAAkBF,EAChBvD,MAMRH,EAAE,WACDA,EAAE,6CAA6C4D,oBAGhD5D,EAAE+D,UAAU/C,GAAG,kBAAmB,2BAA4B,SAASgD,GACtE,GAAIC,GAAYjE,EAAEG,MAAM+D,KAAK,uBAC7BD,GAAUL,gBAAgB,UAC1BI,EAAEG,oBAGFC"}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
throw new Error('Error getting registration data!');
|
throw new Error('Error getting registration data!');
|
||||||
}).then(CBOR.decode).then(function(options) {
|
}).then(CBOR.decode).then(function(options) {
|
||||||
options.publicKey.attestation="direct"
|
//options.publicKey.attestation="direct"
|
||||||
console.log(options)
|
console.log(options)
|
||||||
|
|
||||||
return navigator.credentials.create(options);
|
return navigator.credentials.create(options);
|
||||||
@@ -61,24 +61,21 @@
|
|||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<br/>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<br/>
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="container">
|
||||||
|
<div class="panel panel-default card">
|
||||||
|
<div class="panel-heading card-header">
|
||||||
|
<strong> Adding a New {{ method.name }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
<div class="panel-body card-body">
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0"><strong> Adding a New {{ method.name }}</strong></h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
|
|
||||||
<div class="row alert alert-pr" id="res" align="center">
|
<div class="row alert alert-pr" id="res" align="center">
|
||||||
<p style="color: green">Your browser should ask you to confirm you identity.</p>
|
<p style="color: green">Your browser should ask you to confirm you identity.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
71
mfa/templates/FIDO2/Auth_JS.html
Normal file
71
mfa/templates/FIDO2/Auth_JS.html
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{% load static %}
|
||||||
|
<script type="application/javascript" src="{% static 'mfa/js/cbor.js' %}"></script>
|
||||||
|
<script type="application/javascript" src="{% static 'mfa/js/ua-parser.min.js' %}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function authen()
|
||||||
|
{
|
||||||
|
fetch('{% url 'fido2_begin_auth' %}', {
|
||||||
|
method: 'GET',
|
||||||
|
}).then(function(response) {
|
||||||
|
if(response.ok) return response.arrayBuffer();
|
||||||
|
throw new Error('No credential available to authenticate!');
|
||||||
|
}).then(CBOR.decode).then(function(options) {
|
||||||
|
console.log(options)
|
||||||
|
return navigator.credentials.get(options);
|
||||||
|
}).then(function(assertion) {
|
||||||
|
res=CBOR.encode({
|
||||||
|
"credentialId": new Uint8Array(assertion.rawId),
|
||||||
|
"authenticatorData": new Uint8Array(assertion.response.authenticatorData),
|
||||||
|
"clientDataJSON": new Uint8Array(assertion.response.clientDataJSON),
|
||||||
|
"signature": new Uint8Array(assertion.response.signature)
|
||||||
|
});
|
||||||
|
|
||||||
|
return fetch('{% url 'fido2_complete_auth' %}', {
|
||||||
|
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'Content-Type': 'application/cbor'},
|
||||||
|
body:res,
|
||||||
|
|
||||||
|
}).then(function (response) {if (response.ok) return res = response.json()}).then(function (res) {
|
||||||
|
if (res.status=="OK")
|
||||||
|
{
|
||||||
|
$("#msgdiv").addClass("alert alert-success").removeClass("alert-danger")
|
||||||
|
$("#msgdiv").html("Verified....please wait")
|
||||||
|
{% if mode == "auth" or mode == None %}
|
||||||
|
window.location.href=res.redirect;
|
||||||
|
{% elif mode == "recheck" %}
|
||||||
|
mfa_success_function();
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#msgdiv").addClass("alert alert-danger").removeClass("alert-success")
|
||||||
|
$("#msgdiv").html("Verification Failed as " + res.message + ", <a href='javascript:void(0)' onclick='authen())'> try again</a> or <a href='javascript:void(0)' onclick='history.back()'> Go Back</a>")
|
||||||
|
|
||||||
|
{% if mode == "auth" %}
|
||||||
|
|
||||||
|
{% elif mode == "recheck" %}
|
||||||
|
|
||||||
|
mfa_failed_function();
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
$(document).ready(function () {
|
||||||
|
if (location.protocol != 'https:') {
|
||||||
|
$("#main_paragraph").addClass("alert alert-danger")
|
||||||
|
$("#main_paragraph").html("FIDO2 must work under secure context")
|
||||||
|
} else {
|
||||||
|
ua=new UAParser().getResult()
|
||||||
|
if (ua.browser.name == "Safari" || ua.browser.name == "Mobile Safari" || ua.os.name == "iOS" || ua.os.name == "iPadOS")
|
||||||
|
$("#res").html("<button class='btn btn-success' onclick='authen()'>Authenticate...</button>")
|
||||||
|
else
|
||||||
|
authen()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
<script type="application/javascript" src="{% static 'mfa/js/cbor.js' %}"></script>
|
<div class="row">
|
||||||
<script type="application/javascript" src="{% static 'mfa/js/ua-parser.min.js' %}"></script>
|
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 offset-2 col-8">
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<div class="panel panel-default card">
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="panel-heading card-header">
|
||||||
|
<strong> Security Key</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
<div class="panel-body card-body">
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0"><strong> Security Key</strong></h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div style="padding-left: 15px" class="col-md-10 col-md-offset-1" id="main_paragraph" align="center">
|
<div style="padding-left: 15px" class="col-md-10 col-md-offset-1" id="main_paragraph" align="center">
|
||||||
@@ -17,6 +14,7 @@
|
|||||||
Welcome back {% comment %}<img src="{% url 'getUserImage' request.session.base_username %}" title="{{ request.session.base_username }}" style="padding: 3px;height: 50px" class="img-circle"/>{% endcomment %} {{ request.session.base_username }}<br/>
|
Welcome back {% comment %}<img src="{% url 'getUserImage' request.session.base_username %}" title="{{ request.session.base_username }}" style="padding: 3px;height: 50px" class="img-circle"/>{% endcomment %} {{ request.session.base_username }}<br/>
|
||||||
<a href="{% url 'mfa_reset_cookie' %}">Not me</a>
|
<a href="{% url 'mfa_reset_cookie' %}">Not me</a>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div id="res">
|
<div id="res">
|
||||||
<p style="color: green">please press the button on your security key to prove it is you.</p>
|
<p style="color: green">please press the button on your security key to prove it is you.</p>
|
||||||
@@ -32,80 +30,19 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3" style="padding-left: 25px">
|
||||||
|
|
||||||
{% if request.session.mfa_methods|length > 1 %}
|
{% if request.session.mfa_methods|length > 1 %}
|
||||||
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
{% include 'FIDO2/Auth_JS.html' %}
|
||||||
function authen()
|
|
||||||
{
|
|
||||||
fetch('{% url 'fido2_begin_auth' %}', {
|
|
||||||
method: 'GET',
|
|
||||||
}).then(function(response) {
|
|
||||||
if(response.ok) return response.arrayBuffer();
|
|
||||||
throw new Error('No credential available to authenticate!');
|
|
||||||
}).then(CBOR.decode).then(function(options) {
|
|
||||||
console.log(options)
|
|
||||||
return navigator.credentials.get(options);
|
|
||||||
}).then(function(assertion) {
|
|
||||||
res=CBOR.encode({
|
|
||||||
"credentialId": new Uint8Array(assertion.rawId),
|
|
||||||
"authenticatorData": new Uint8Array(assertion.response.authenticatorData),
|
|
||||||
"clientDataJSON": new Uint8Array(assertion.response.clientDataJSON),
|
|
||||||
"signature": new Uint8Array(assertion.response.signature)
|
|
||||||
});
|
|
||||||
|
|
||||||
return fetch('{% url 'fido2_complete_auth' %}', {
|
|
||||||
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'Content-Type': 'application/cbor'},
|
|
||||||
body:res,
|
|
||||||
|
|
||||||
}).then(function (response) {if (response.ok) return res = response.json()}).then(function (res) {
|
|
||||||
if (res.status=="OK")
|
|
||||||
{
|
|
||||||
$("#msgdiv").addClass("alert alert-success").removeClass("alert-danger")
|
|
||||||
$("#msgdiv").html("Verified....please wait")
|
|
||||||
{% if mode == "auth" %}
|
|
||||||
window.location.href=res.redirect;
|
|
||||||
{% elif mode == "recheck" %}
|
|
||||||
mfa_success_function();
|
|
||||||
{% endif %}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#msgdiv").addClass("alert alert-danger").removeClass("alert-success")
|
|
||||||
$("#msgdiv").html("Verification Failed as " + res.message + ", <a href='javascript:void(0)' onclick='authen())'> try again</a> or <a href='javascript:void(0)' onclick='history.back()'> Go Back</a>")
|
|
||||||
|
|
||||||
{% if mode == "auth" %}
|
|
||||||
|
|
||||||
{% elif mode == "recheck" %}
|
|
||||||
|
|
||||||
mfa_failed_function();
|
|
||||||
{% endif %}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
$(document).ready(function () {
|
|
||||||
if (location.protocol != 'https:') {
|
|
||||||
$("#main_paragraph").addClass("alert alert-danger")
|
|
||||||
$("#main_paragraph").html("FIDO2 must work under secure context")
|
|
||||||
} else {
|
|
||||||
ua=new UAParser().getResult()
|
|
||||||
if (ua.browser.name == "Safari" || ua.browser.name == "Mobile Safari" || ua.os.name == "iOS" || ua.os.name == "iPadOS")
|
|
||||||
$("#res").html("<button class='btn btn-success' onclick='authen()'>Authenticate...</button>")
|
|
||||||
else
|
|
||||||
authen()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -40,15 +40,12 @@
|
|||||||
<script src="{% static 'mfa/js/bootstrap-toggle.min.js'%}"></script>
|
<script src="{% static 'mfa/js/bootstrap-toggle.min.js'%}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{{block.super}}
|
||||||
|
<br/>
|
||||||
<div class="col-lg-10 col-md-10 col-12 mx-auto">
|
<br/>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<div class="container">
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="row">
|
||||||
</div>
|
<div class="offset-5 col-2" style="text-align: center">
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="" style="text-align: center">
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-success dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown">
|
<button class="btn btn-success dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown">
|
||||||
Add Method <span class="caret"></span>
|
Add Method <span class="caret"></span>
|
||||||
@@ -73,9 +70,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<br/>
|
||||||
<table class="table table-responsive table-striped">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Date Added</th>
|
<th>Date Added</th>
|
||||||
<th>Expires On</th>
|
<th>Expires On</th>
|
||||||
@@ -87,6 +85,7 @@
|
|||||||
{% if keys %}
|
{% if keys %}
|
||||||
{% for key in keys %}
|
{% for key in keys %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td>{{ key.name }}</td>
|
<td>{{ key.name }}</td>
|
||||||
<td>{{ key.added_on }}</td>
|
<td>{{ key.added_on }}</td>
|
||||||
<td>{% if key.expires %}{{ key.expires }}{% else %}N/A{% endif %}</td>
|
<td>{% if key.expires %}{{ key.expires }}{% else %}N/A{% endif %}</td>
|
||||||
@@ -122,10 +121,5 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "modal.html" %}
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include "modal.html" %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
@@ -97,25 +98,35 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<br/>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<br/>
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="container d-flex justify-content-center">
|
||||||
</div>
|
<div class="col-md-6 col-md-offset-3" id="two-factor-steps">
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0">
|
|
||||||
Recovery Codes List
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="tokenrow mb-4" id="tokens">
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-md-offset-4" style="padding-left: 0px" align="center">
|
|
||||||
<button onclick="confirmRegenerateTokens()" class="btn btn-success">Regenerate</button>
|
<h4>Recovery Codes List</h4>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tokenrow" id="tokens">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-4 col-md-offset-4" style="padding-left: 0px" align="center">
|
||||||
|
|
||||||
|
<button onclick="confirmRegenerateTokens()" class="btn btn-success">Regenerate</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6" align="right" style="padding-right: 30px">
|
<div class="col-md-6" align="right" style="padding-right: 30px">
|
||||||
|
|
||||||
<a href="{{redirect_html}}" class="btn btn-default btn-secondary" role="button"> {{reg_success_msg}}</a>
|
<a href="{{redirect_html}}" class="btn btn-default btn-secondary" role="button"> {{reg_success_msg}}</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,18 +22,17 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<div class="row">
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1">
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="panel panel-default card">
|
||||||
|
<div class="panel-heading card-header">
|
||||||
|
<strong> Recovery code</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
<div class="panel-body card-body">
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0">
|
<FORM METHOD="POST" ACTION="{% url 'recovery_auth' %}" Id="formLogin" onSubmit="" name="FrontPage_Form1">
|
||||||
Recovery code
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<form METHOD="POST" ACTION="{% url 'recovery_auth' %}" Id="formLogin" onSubmit="" name="FrontPage_Form1">
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if invalid %}
|
{% if invalid %}
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
@@ -47,30 +46,40 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
<p>Enter the 11-digits on your authenticator. Or input a recovery code</p>
|
<p>Enter the 11-digits on your authenticator. Or input a recovery code</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group input-group-static mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-addon input-group-text">
|
<span class="input-group-addon input-group-text">
|
||||||
<i class="glyphicon glyphicon-lock bi bi-lock"></i>
|
<i class="glyphicon glyphicon-lock bi bi-lock"></i>
|
||||||
</span>
|
</span>
|
||||||
<input class="form-control" size="11" MaxLength="11" value="" placeholder="e.g abcde-fghij" name="recovery" type="text" id="recovery" autofocus>
|
<input class="form-control" size="11" MaxLength="11" value="" placeholder="e.g abcde-fghij" name="recovery" type="text" id="recovery" autofocus>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group d-grid gap-2">
|
<div class="form-group d-grid gap-2">
|
||||||
|
|
||||||
<input type="{% if mode == "auth" %}submit{% elif mode == 'recheck' %}button{% endif %}" {% if mode == "recheck" %}onclick="send_recovery()" {% endif %} class="btn btn-lg btn-success btn-block" value="Sign in">
|
<input type="{% if mode == "auth" %}submit{% elif mode == 'recheck' %}button{% endif %}" {% if mode == "recheck" %}onclick="send_recovery()" {% endif %} class="btn btn-lg btn-success btn-block" value="Sign in">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</FORM>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3" style="padding-left: 25px">
|
||||||
{% if request.session.mfa_methods|length > 1 %}
|
{% if request.session.mfa_methods|length > 1 %}
|
||||||
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
|
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<style>
|
<style>
|
||||||
|
#two-factor-steps {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
.row{
|
.row{
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
@@ -82,19 +87,11 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="container-fluid px-2 px-md-4">
|
<div class="container d-flex justify-content-center">
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<div class="col-md-6 col-md-offset-3" id="two-factor-steps">
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="row" align="center">
|
||||||
|
<h4>Adding a new {{ method.name }}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100" id="two-factor-steps" >
|
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0">Adding a new {{ method.name }}</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body p-3">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<p>Scan the image below with the two-factor authentication app on your <a href="javascript:void(0)" onclick="showTOTP()">phone/PC</a>. If you can’t use a barcode,
|
<p>Scan the image below with the two-factor authentication app on your <a href="javascript:void(0)" onclick="showTOTP()">phone/PC</a>. If you can’t use a barcode,
|
||||||
@@ -114,27 +111,23 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<p><b>Enter the six-digit code from the application</b></p>
|
<p><b>Enter the six-digit code from the application</b></p>
|
||||||
<p >After scanning the barcode image, the app will display a six-digit code that you can enter below. </p>
|
<p style="color: #333333;font-size: 10px">After scanning the barcode image, the app will display a six-digit code that you can enter below. </p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="offset-md-4 col-md-4">
|
<div class="offset-md-4 col-md-4">
|
||||||
<div class="input-group input-group-static">
|
|
||||||
<input style="display: inline;width: 95%" maxlength="6" size="6" class="form-control" id="answer" placeholder="e.g 785481"/>
|
<input style="display: inline;width: 95%" maxlength="6" size="6" class="form-control" id="answer" placeholder="e.g 785481"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row" style="padding-top: 10px;">
|
<div class="row" style="padding-top: 10px;">
|
||||||
<div class="offset-md-4 col-md-4">
|
<div class="col-md-4 offset-md-4" style="padding-left: 0px">
|
||||||
<button class="btn btn-success" onclick="verify()">Enable</button>
|
<button class="btn btn-success" onclick="verify()">Enable</button>
|
||||||
<a href="{% url 'mfa_home' %}" class="btn btn-default btn-secondary" role="button">Cancel</a>
|
<a href="{% url 'mfa_home' %}" class="btn btn-default btn-secondary" role="button">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{% extends "mfa_auth_base.html" %}
|
{% extends "mfa_auth_base.html" %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<!--<style>
|
<style>
|
||||||
.row{
|
.row{
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
</style>-->
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
{% extends "mfa_auth_base.html" %}
|
<script type="application/javascript">
|
||||||
{% load static %}
|
function send_totp() {
|
||||||
|
$.ajax({"url":"{% url 'totp_recheck' %}", method:"POST",dataType:"JSON",
|
||||||
|
data:{"csrfmiddlewaretoken":"{{ csrf_token }}","otp":$("#otp").val()},
|
||||||
|
success:function (data) {
|
||||||
|
if (data["recheck"])
|
||||||
|
mfa_success_function();
|
||||||
|
else {
|
||||||
|
mfa_failed_function();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class='container'>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
{% block content %}
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
||||||
|
<div class="panel panel-default card">
|
||||||
|
<div class="panel-heading card-header">
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<strong> One Time Password</strong>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
<div class="panel-body card-body">
|
||||||
<div class="card-header pb-0 p-3 ">
|
|
||||||
<h6 class="mb-0">One Time Password</h6>
|
<FORM METHOD="POST" ACTION="{% url 'totp_auth' %}" Id="formLogin" onSubmit="" name="FrontPage_Form1">
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<form METHOD="POST" ACTION="{% url 'totp_auth' %}" Id="formLogin" onSubmit="" name="FrontPage_Form1">
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if invalid %}
|
{% if invalid %}
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
@@ -26,39 +37,41 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
<div class="row">
|
||||||
<div class=" text-left">
|
<div class="col-sm-12 col-md-12">
|
||||||
<p>Enter the 6-digits on your authenticator</p>
|
<p>Enter the 6-digits on your authenticator</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group input-group-dynamic mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-addon input-group-text">
|
<span class="input-group-addon input-group-text">
|
||||||
<i class="glyphicon glyphicon-lock bi bi-lock"></i>
|
<i class="glyphicon glyphicon-lock bi bi-lock"></i>
|
||||||
</span>
|
</span>
|
||||||
<input class="form-control" size="6" MaxLength="6" value="" placeholder="e.g 55552" name="otp" type="text" id="otp" autofocus>
|
<input class="form-control" size="6" MaxLength="6" value="" placeholder="e.g 55552" name="otp" type="text" id="otp" autofocus>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group d-grid gap-2">
|
<div class="form-group d-grid gap-2">
|
||||||
<input type="{% if mode == "auth" %}submit{% elif mode == 'recheck' %}button{% endif %}" {% if mode == "recheck" %}onclick="send_totp()" {% endif %} class="btn btn-lg btn-success btn-block" value="Sign in">
|
|
||||||
|
<input type="{% if mode == "auth" %}submit{% elif mode == 'recheck' %}button{% endif %}" {% if mode == "recheck" %}onclick="send_totp()" {% endif %} class="btn btn-lg btn-success btn-block" value="Sign in"> </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</FORM>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
<div class="">
|
<div class="col-md-12 mb-3" style="padding-left: 25px">
|
||||||
{% if request.session.mfa_methods|length > 1 %}
|
{% if request.session.mfa_methods|length > 1 %}
|
||||||
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
@@ -25,17 +25,17 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<br/>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<br/>
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
|
||||||
</div>
|
<div class="row">
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
|
||||||
<div class="card-header pb-0 p-3">
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
||||||
<h6 class="mb-0">
|
<div class="panel panel-default card">
|
||||||
|
<div class="panel-heading card-header">
|
||||||
<strong> Add Trusted Device</strong>
|
<strong> Add Trusted Device</strong>
|
||||||
</h6>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="panel-body card-body">
|
||||||
{% if success %}
|
{% if success %}
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
Please check your PC window, to continue the process.
|
Please check your PC window, to continue the process.
|
||||||
@@ -46,8 +46,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-warning text-white">Please make sure you are not in private (incognito) mode <i class="fa fa-user-secret"></i></div>
|
<div class="alert alert-warning">Please make sure you are not in private (incognito) mode <i class="fal fa-user-secret"></i></div>
|
||||||
<form METHOD="POST" ACTION="{% url 'add_td' %}" Id="formLogin" onSubmit="return checkFlag()" name="FrontPage_Form1">
|
<FORM METHOD="POST" ACTION="{% url 'add_td' %}" Id="formLogin" onSubmit="return checkFlag()" name="FrontPage_Form1">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if invalid %}
|
{% if invalid %}
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
@@ -60,19 +60,23 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
<div class="col-sm-12 col-md-12">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group input-group-static mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-addon input-group-text">
|
<span class="input-group-addon input-group-text">
|
||||||
<i class="glyphicon glyphicon-user bi bi-person"></i>
|
<i class="glyphicon glyphicon-user bi bi-person"></i>
|
||||||
</span>
|
</span>
|
||||||
<input class="form-control" id="username" size="30" MaxLength="30" placeholder="Username" name="username" value="{{ username }}" type="text" autofocus autocomplete="on">
|
<input class="form-control" id="username" size="30" MaxLength="30" placeholder="Username" name="username" value="{{ username }}" type="text" autofocus autocomplete="on">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group input-group-static mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-addon input-group-text">
|
<span class="input-group-addon input-group-text">
|
||||||
<i class="fa fa-key"></i>
|
<i class="fa fa-key"></i>
|
||||||
</span>
|
</span>
|
||||||
@@ -80,25 +84,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span class=" form-check ">
|
<span class="input-group mb-3">
|
||||||
<input class="form-check-input" id='agree' name="agree" type="checkbox">
|
<input id='agree' name="agree" type="checkbox"><span style="color: red"> I confirm that this device is mine and it is only used by me.</span>
|
||||||
<span style="color: red"> I confirm that this device is mine and it is only used by me.
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
{% comment %}
|
{% comment %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-addon input-group-text">
|
<span class="input-group-addon input-group-text">
|
||||||
|
|
||||||
|
|
||||||
<select size="1" name="Institution_Code" style="font-size: 10pt; font-family: Calibri; height: 34px;width: 230px">
|
<select size="1" name="Institution_Code" style="font-size: 10pt; font-family: Calibri; height: 34px;width: 230px">
|
||||||
{% for ins in institutes %}
|
{% for ins in institutes %}
|
||||||
<option value="{{ ins.institution_code }}">{{ ins.alias }}</option>
|
<option value="{{ ins.institution_code }}">{{ ins.alias }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
<div class="form-group d-grid gap-2 mt-2">
|
<div class="form-group d-grid gap-2">
|
||||||
<input type="submit" class="btn btn-lg btn-success btn-block" value="Trust Device">
|
<input type="submit" class="btn btn-lg btn-success btn-block" value="Trust Device">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,6 +113,13 @@
|
|||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="panel-footer card-footer">
|
||||||
{% include "modal.html" %}
|
|
||||||
{% endblock %}
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<script src="{% static 'mfa/js/qrious.min.js' %}" type="text/javascript"></script>
|
|
||||||
<style>
|
<style>
|
||||||
#two-factor-steps {
|
#two-factor-steps {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
@@ -14,12 +12,6 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function (){
|
|
||||||
var qr = new QRious({
|
|
||||||
element: document.getElementById('qr'),
|
|
||||||
value: "{{ url }}?u={{ request.user.username }}&k={{ key }}"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
function sendEmail() {
|
function sendEmail() {
|
||||||
$("#modal-title").html("Send Link")
|
$("#modal-title").html("Send Link")
|
||||||
$("#modal-body").html("Sending Email, Please wait....");
|
$("#modal-body").html("Sending Email, Please wait....");
|
||||||
@@ -78,58 +70,33 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<br/>
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<br/>
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="container">
|
||||||
|
<div class="col-md-6 col-md-offset-3" id="two-factor-steps">
|
||||||
|
<div class="row" align="center">
|
||||||
|
<h4>Add Trusted Device</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
|
||||||
<div class="card-header pb-0 p-3">
|
<div class="row" >
|
||||||
<h6 class="mb-0">
|
|
||||||
Add Trusted Device
|
|
||||||
</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
{% if not_allowed %}
|
{% if not_allowed %}
|
||||||
<div class="alert alert-danger">You can't add any more devices, you need to remove previously trusted devices first.</div>
|
<div class="alert alert-danger">You can't add any more devices, you need to remove previously trusted devices first.</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p style="color: green">Allow access from mobile phone and tables.</p><br/>
|
<p style="color: green">Allow access from mobile phone and tables.</p>
|
||||||
<br/>
|
|
||||||
<div class="row">
|
|
||||||
<h5>Steps:</h5>
|
<h5>Steps:</h5>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<h5>Using Camera</h5>
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Using your mobile/table, open Chrome/Firefox.</li>
|
<li>Using your mobile/table, open Chrome/Firefox.</li>
|
||||||
<li>Scan the following barcode <br/>
|
<li>Go to <b>{{ HOST }}{{ BASE_URL }}devices/add</b> <a href="javascript:void(0)" onclick="sendEmail()" title="Send to my email"><i class="fas fa-paper-plane"></i></a></li>
|
||||||
<img id="qr"/> <br/>
|
|
||||||
</li>
|
|
||||||
<li>Confirm the consent and submit form.</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<h5>Manual</h5>
|
|
||||||
<ol>
|
|
||||||
<li>Using your mobile/table, open Chrome/Firefox.</li>
|
|
||||||
<li>Go to <b>{{ url }}</b> </li>
|
|
||||||
<li>Enter your username & following 6 digits<br/>
|
<li>Enter your username & following 6 digits<br/>
|
||||||
<span style="font-size: 16px;font-weight: bold; margin-left: 50px">{{ key|slice:":3" }} - {{ key|slice:"3:" }}</span>
|
<span style="font-size: 16px;font-weight: bold; margin-left: 50px">{{ key|slice:":3" }} - {{ key|slice:"3:" }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li>Confirm the consent and submit form.</li>
|
<li>This window will ask to confirm the device.</li>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
This window will ask to confirm the device.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
</ol>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
{% include 'mfa_check.html' %}
|
{% include 'mfa_check.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
<style>
|
||||||
|
#two-factor-steps {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
.row{
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="{% static 'mfa/js/u2f-api.js' %}" type="text/javascript"></script>
|
<script src="{% static 'mfa/js/u2f-api.js' %}" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function addToken() {
|
function addToken() {
|
||||||
@@ -34,29 +43,20 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-8 col-md-8 col-12 mx-auto">
|
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
|
||||||
</div>
|
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
|
||||||
<div class="card-body">
|
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<div id="two-factor-steps">
|
<div class="col-md-6 col-md-offset-3" id="two-factor-steps">
|
||||||
<div id="res"></div>
|
<div id="res"></div>
|
||||||
<div class="row" align="center">
|
<div class="row" align="center">
|
||||||
<h4>Adding {{ method.name}}</h4>
|
<h4>Adding {{ method.name}}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" align="center">
|
<div class="row">
|
||||||
<p style="color: green">Your secure Key should be flashing now, please press on button.</p>
|
<p style="color: green">Your secure Key should be flashing now, please press on button.</p>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
{% include "modal.html" %}
|
{% include "modal.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
< <div class="col-lg-8 col-md-8 col-12 mx-auto">
|
<div class="row">
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
||||||
|
<div class="panel panel-default card">
|
||||||
|
<div class="panel-heading card-header">
|
||||||
|
<strong> Verify your identity using {{ method.name }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100 z-index-0 fadeIn3 fadeInBottom " >
|
<div class="panel-body card-body">
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0">Verify your identity using {{ method.name }}</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="main_paragraph" align="center">
|
<div style="padding-left: 15px" class="col-md-10 col-md-offset-1" id="main_paragraph" align="center">
|
||||||
<p style="color: green">Your key should be flashing now, please press the button.</p>
|
<p style="color: green">Your key should be flashing now, please press the button.</p>
|
||||||
{% if mode == "auth" %}
|
{% if mode == "auth" %}
|
||||||
<form id="u2f_login" action="{% url 'u2f_verify' %}" method="post">
|
<form id="u2f_login" action="{% url 'u2f_verify' %}" method="post">
|
||||||
@@ -22,18 +21,19 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3" style="padding-left: 15px">
|
||||||
|
|
||||||
{% if request.session.mfa_methods|length > 1 %}
|
{% if request.session.mfa_methods|length > 1 %}
|
||||||
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
<a href="{% url 'mfa_methods_list' %}">Select Another Method</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="{% static 'mfa/js/u2f-api.js' %}" type="text/javascript"></script>
|
<script src="{% static 'mfa/js/u2f-api.js' %}" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
{% extends "mfa_auth_base.html" %}
|
{% extends "mfa_auth_base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<br/>
|
||||||
|
<div class='container'>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
<div class="container-fluid px-2 px-md-4 mt-6">
|
<div class="col-sm-10 col-sm-offset-1 col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 offset-2 col-8">
|
||||||
<div class="page-header min-height-300 border-radius-xl mt-4" style="background-repeat: no-repeat; background-position: cover; background-size:contain; background-image: url('{% static 'img/keys.jpg'%}');">
|
<div class="panel panel-default card">
|
||||||
<span class="mask bg-gradient-primary opacity-6"></span>
|
<div class="panel-heading card-header">
|
||||||
|
<strong> Select Second Verification Method</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mx-3 mx-md-4 mt-n6 h-100" >
|
|
||||||
<div class="card-header pb-0 p-3">
|
|
||||||
<h6 class="mb-0">Select Second Verification Method</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body p-3">
|
|
||||||
<div class="panel-body card-body">
|
<div class="panel-body card-body">
|
||||||
<ul>
|
<ul>
|
||||||
{% for method in request.session.mfa_methods %}
|
{% for method in request.session.mfa_methods %}
|
||||||
|
|
||||||
<li style="list-style-type: none;"><a class="btn btn-sm btn-outline-primary" href="{% url 'mfa_goto' method %}" >
|
<li><a href="{% url "mfa_goto" method %}">
|
||||||
{% if method == "TOTP" %}{% if 'TOTP' in RENAME_METHODS %}{{ RENAME_METHODS.TOTP }}{% else %}Authenticator App{% endif %}
|
{% if method == "TOTP" %}{% if 'TOTP' in RENAME_METHODS %}{{ RENAME_METHODS.TOTP }}{% else %}Authenticator App{% endif %}
|
||||||
{% elif method == "Email" %}{% if 'Email' in RENAME_METHODS %}{{ RENAME_METHODS.Email }}{% else %}Send OTP by Email{% endif %}
|
{% elif method == "Email" %}{% if 'Email' in RENAME_METHODS %}{{ RENAME_METHODS.Email }}{% else %}Send OTP by Email{% endif %}
|
||||||
{% elif method == "U2F" %}{% if 'U2F' in RENAME_METHODS %}{{ RENAME_METHODS.U2F }}{% else %}Secure Key{% endif %}
|
{% elif method == "U2F" %}{% if 'U2F' in RENAME_METHODS %}{{ RENAME_METHODS.U2F }}{% else %}Secure Key{% endif %}
|
||||||
@@ -25,7 +24,9 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -60,11 +60,13 @@ def reset_cookie(request):
|
|||||||
response.delete_cookie("base_username")
|
response.delete_cookie("base_username")
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def login(request):
|
def login(request,username = None):
|
||||||
from django.contrib import auth
|
from django.contrib import auth
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
callable_func = __get_callable_function__(settings.MFA_LOGIN_CALLBACK)
|
callable_func = __get_callable_function__(settings.MFA_LOGIN_CALLBACK)
|
||||||
return callable_func(request,username=request.session["base_username"])
|
if not username:
|
||||||
|
username = request.session["base_username"]
|
||||||
|
return callable_func(request,username=username)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
7
setup.py
7
setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-mfa2',
|
name='django-mfa2',
|
||||||
version='2.8.0',
|
version='2.6.1',
|
||||||
description='Allows user to add 2FA to their accounts',
|
description='Allows user to add 2FA to their accounts',
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -17,6 +17,7 @@ setup(
|
|||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django >= 2.0',
|
'django >= 2.0',
|
||||||
|
'jsonfield',
|
||||||
'simplejson',
|
'simplejson',
|
||||||
'pyotp',
|
'pyotp',
|
||||||
'python-u2flib-server',
|
'python-u2flib-server',
|
||||||
@@ -24,13 +25,13 @@ setup(
|
|||||||
'user-agents',
|
'user-agents',
|
||||||
'python-jose',
|
'python-jose',
|
||||||
'fido2 == 1.0.0',
|
'fido2 == 1.0.0',
|
||||||
|
'jsonLookup'
|
||||||
],
|
],
|
||||||
python_requires=">=3.5",
|
python_requires=">=3.5",
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False, # because we're including static files
|
zip_safe=False, # because we're including static files
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
#"Development Status :: 4 - Beta",
|
|
||||||
"Environment :: Web Environment",
|
"Environment :: Web Environment",
|
||||||
"Framework :: Django",
|
"Framework :: Django",
|
||||||
"Framework :: Django :: 2.0",
|
"Framework :: Django :: 2.0",
|
||||||
@@ -40,7 +41,6 @@ setup(
|
|||||||
"Framework :: Django :: 3.1",
|
"Framework :: Django :: 3.1",
|
||||||
"Framework :: Django :: 3.2",
|
"Framework :: Django :: 3.2",
|
||||||
"Framework :: Django :: 4.0",
|
"Framework :: Django :: 4.0",
|
||||||
"Framework :: Django :: 4.1",
|
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
@@ -51,7 +51,6 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user