From 53f936a2c683db5b66dee3b8692000e00ab30334 Mon Sep 17 00:00:00 2001 From: Mohamed El-Kalioby Date: Mon, 18 Jan 2021 18:53:11 +0300 Subject: [PATCH] Testing Touch ID --- mfa/static/mfa/js/ua-parser.min.js | 9 +++++++++ mfa/templates/FIDO2/Add.html | 15 +++++++++++++-- mfa/templates/FIDO2/recheck.html | 11 +++++++++-- setup.py | 3 ++- 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 mfa/static/mfa/js/ua-parser.min.js diff --git a/mfa/static/mfa/js/ua-parser.min.js b/mfa/static/mfa/js/ua-parser.min.js new file mode 100644 index 0000000..23e2d07 --- /dev/null +++ b/mfa/static/mfa/js/ua-parser.min.js @@ -0,0 +1,9 @@ +/*! + * UAParser.js v0.7.23 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2019 Faisal Salman + * Licensed under MIT License + */ +(function(window,undefined){"use strict";var LIBVERSION="0.7.23",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j + {% endblock %} @@ -56,7 +67,7 @@
-

Your broswer should ask you to confirm you indentity.

+

Your browser should ask you to confirm you identity.

diff --git a/mfa/templates/FIDO2/recheck.html b/mfa/templates/FIDO2/recheck.html index 5fe9781..3871987 100644 --- a/mfa/templates/FIDO2/recheck.html +++ b/mfa/templates/FIDO2/recheck.html @@ -1,5 +1,6 @@ {% load static %} +
@@ -17,7 +18,9 @@
{% endif %} -

please press the button on your security key to prove it is you.

+
+

please press the button on your security key to prove it is you.

+
{% if mode == "auth" %}
@@ -101,7 +104,11 @@ $("#main_paragraph").addClass("alert alert-danger") $("#main_paragraph").html("FIDO2 must work under secure context") } else { - authen() + ua=UAParser() + if (ua.getBrowser().name == "Safari") + $("#res").html("") + else + authen() } }); diff --git a/setup.py b/setup.py index fdc621a..bd6a7d4 100644 --- a/setup.py +++ b/setup.py @@ -24,9 +24,10 @@ setup( 'ua-parser', 'user-agents', 'python-jose', - 'fido2 == 0.8.1', + # 'fido2 == 0.8.1', 'jsonLookup' ], + dependency_links =["https://github.com/Yubico/python-fido2/tarball/master"], python_requires=">=3.5", include_package_data=True, zip_safe=False, # because we're including static files