Changeset 1476891
- Timestamp:
- 08/17/2016 01:16:07 PM (9 years ago)
- Location:
- duo-wordpress/trunk
- Files:
-
- 4 edited
-
duo_web/Duo-Web-v2.js (modified) (6 diffs)
-
duo_web/Duo-Web-v2.min.js (modified) (1 diff)
-
duo_wordpress.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
duo-wordpress/trunk/duo_web/Duo-Web-v2.js
r1212814 r1476891 14 14 duoSig, 15 15 appSig, 16 iframe; 16 iframe, 17 submitCallback; 17 18 18 19 function throwError(message, url) { … … 191 192 * @param {String} [options.post_action=''] URL to POST back to after successful auth 192 193 * @param {String} [options.post_argument='sig_response'] Parameter name to use for response token 194 * @param {Function} [options.submit_callback] If provided, duo will not submit the form instead execute 195 * the callback function with reference to the "duo_form" form object 196 * submit_callback can be used to prevent the webpage from reloading. 193 197 */ 194 198 function init(options) { … … 216 220 iframeId = options.iframe; 217 221 } 222 } 223 224 if (typeof options.submit_callback === 'function') { 225 submitCallback = options.submit_callback; 218 226 } 219 227 } … … 300 308 iframe.src = [ 301 309 'https://', host, '/frame/web/v1/auth?tx=', duoSig, 302 '&parent=', document.location.href 310 '&parent=', encodeURIComponent(document.location.href), 311 '&v=2.3' 303 312 ].join(''); 304 313 … … 338 347 339 348 // away we go! 340 form.submit(); 349 if (typeof submitCallback === "function") { 350 submitCallback.call(null, form); 351 } else { 352 form.submit(); 353 } 341 354 } 342 355 … … 348 361 init: init, 349 362 _parseSigRequest: parseSigRequest, 350 _isDuoMessage: isDuoMessage 363 _isDuoMessage: isDuoMessage, 364 _doPostBack: doPostBack 351 365 }; 352 366 }(document, window)); -
duo-wordpress/trunk/duo_web/Duo-Web-v2.min.js
r1212814 r1476891 1 window.Duo=function(e,t){var i=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/;var n=/^ERR\|[\w\s\.\(\)]+$/;var o="duo_iframe",a="",r="sig_response",s,f,u,d,m;function c(e,t){throw new Error("Duo Web SDK error: "+e+(t?"\n"+"See "+t+" for more information":""))}function h(e){return e.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()}function g(e,t){if("dataset"in e){return e.dataset[t]}else{return e.getAttribute("data-"+h(t))}}function p(e,i,n,o){if("addEventListener"in t){e.addEventListener(i,o,false)}else{e.attachEvent(n,o)}}function l(e,i,n,o){if("removeEventListener"in t){e.removeEventListener(i,o,false)}else{e.detachEvent(n,o)}}function w(t){p(e,"DOMContentLoaded","onreadystatechange",t)}function v(t){l(e,"DOMContentLoaded","onreadystatechange",t)}function E(e){p(t,"message","onmessage",e)}function b(e){l(t,"message","onmessage",e)}function _(e){if(!e){return}if(e.indexOf("ERR|")===0){c(e.split("|")[1])}if(e.indexOf(":")===-1||e.split(":").length!==2){c("Duo was given a bad token. This might indicate a configuration "+"problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps")}var t=e.split(":");f=e;u=t[0];d=t[1];return{sigRequest:e,duoSig:t[0],appSig:t[1]}}function y(){m=e.getElementById(o);if(!m){throw new Error("This page does not contain an iframe for Duo to use."+'Add an element like <iframe id="duo_iframe"></iframe> '+"to this page. "+"See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe "+"for more information.")}q();v(y)}function D(e){return Boolean(e.origin==="https://"+s&&typeof e.data==="string"&&(e.data.match(i)||e.data.match(n)))}function A(t){if(t){if(t.host){s=t.host}if(t.sig_request){_(t.sig_request)}if(t.post_action){a=t.post_action}if(t.post_argument){r=t.post_argument}if(t.iframe){if("tagName"in t.iframe){m=t.iframe}else if(typeof t.iframe==="string"){o=t.iframe}}}if(m){q()}else{m=e.getElementById(o);if(m){q()}else{w(y)}}v(A)}function L(e){if(D(e)){R(e.data);b(L)}}function q(){if(!s){s=g(m,"host");if(!s){c("No API hostname is given for Duo to use. Be sure to pass "+"a `host` parameter to Duo.init, or through the `data-host` "+"attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")}}if(!u||!d){_(g(m,"sigRequest"));if(!u||!d){c("No valid signed request is given. Be sure to give the "+"`sig_request` parameter to Duo.init, or use the "+"`data-sig-request` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")}}if(a===""){a=g(m,"postAction")||a}if(r==="sig_response"){r=g(m,"postArgument")||r}m.src=["https://",s,"/frame/web/v1/auth?tx=",u,"&parent=",e.location.href].join("");E(L)}function R(t){var i=e.createElement("input");i.type="hidden";i.name=r;i.value=t+":"+d;var n=e.getElementById("duo_form");if(!n){n=e.createElement("form");m.parentElement.insertBefore(n,m.nextSibling)}n.method="POST";n.action=a;n.appendChild(i);n.submit()}w(A);return{init:A,_parseSigRequest:_,_isDuoMessage:D}}(document,window);1 window.Duo=function(e,t){var i=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/;var o=/^ERR\|[\w\s\.\(\)]+$/;var n="duo_iframe",a="",s="sig_response",r,f,u,d,m,c;function h(e,t){throw new Error("Duo Web SDK error: "+e+(t?"\n"+"See "+t+" for more information":""))}function g(e){return e.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()}function l(e,t){if("dataset"in e){return e.dataset[t]}else{return e.getAttribute("data-"+g(t))}}function p(e,i,o,n){if("addEventListener"in t){e.addEventListener(i,n,false)}else{e.attachEvent(o,n)}}function w(e,i,o,n){if("removeEventListener"in t){e.removeEventListener(i,n,false)}else{e.detachEvent(o,n)}}function v(t){p(e,"DOMContentLoaded","onreadystatechange",t)}function b(t){w(e,"DOMContentLoaded","onreadystatechange",t)}function E(e){p(t,"message","onmessage",e)}function _(e){w(t,"message","onmessage",e)}function y(e){if(!e){return}if(e.indexOf("ERR|")===0){h(e.split("|")[1])}if(e.indexOf(":")===-1||e.split(":").length!==2){h("Duo was given a bad token. This might indicate a configuration "+"problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps")}var t=e.split(":");f=e;u=t[0];d=t[1];return{sigRequest:e,duoSig:t[0],appSig:t[1]}}function D(){m=e.getElementById(n);if(!m){throw new Error("This page does not contain an iframe for Duo to use."+'Add an element like <iframe id="duo_iframe"></iframe> '+"to this page. "+"See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe "+"for more information.")}q();b(D)}function A(e){return Boolean(e.origin==="https://"+r&&typeof e.data==="string"&&(e.data.match(i)||e.data.match(o)))}function L(t){if(t){if(t.host){r=t.host}if(t.sig_request){y(t.sig_request)}if(t.post_action){a=t.post_action}if(t.post_argument){s=t.post_argument}if(t.iframe){if("tagName"in t.iframe){m=t.iframe}else if(typeof t.iframe==="string"){n=t.iframe}}if(typeof t.submit_callback==="function"){c=t.submit_callback}}if(m){q()}else{m=e.getElementById(n);if(m){q()}else{v(D)}}b(L)}function R(e){if(A(e)){B(e.data);_(R)}}function q(){if(!r){r=l(m,"host");if(!r){h("No API hostname is given for Duo to use. Be sure to pass "+"a `host` parameter to Duo.init, or through the `data-host` "+"attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")}}if(!u||!d){y(l(m,"sigRequest"));if(!u||!d){h("No valid signed request is given. Be sure to give the "+"`sig_request` parameter to Duo.init, or use the "+"`data-sig-request` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")}}if(a===""){a=l(m,"postAction")||a}if(s==="sig_response"){s=l(m,"postArgument")||s}m.src=["https://",r,"/frame/web/v1/auth?tx=",u,"&parent=",encodeURIComponent(e.location.href),"&v=2.3"].join("");E(R)}function B(t){var i=e.createElement("input");i.type="hidden";i.name=s;i.value=t+":"+d;var o=e.getElementById("duo_form");if(!o){o=e.createElement("form");m.parentElement.insertBefore(o,m.nextSibling)}o.method="POST";o.action=a;o.appendChild(i);if(typeof c==="function"){c.call(null,o)}else{o.submit()}}v(L);return{init:L,_parseSigRequest:y,_isDuoMessage:A,_doPostBack:B}}(document,window); -
duo-wordpress/trunk/duo_wordpress.php
r1394204 r1476891 4 4 Plugin URI: http://wordpress.org/extend/plugins/duo-wordpress/ 5 5 Description: This plugin enables Duo two-factor authentication for WordPress logins. 6 Version: 2.5. 26 Version: 2.5.3 7 7 Author: Duo Security 8 8 Author URI: http://www.duosecurity.com -
duo-wordpress/trunk/readme.txt
r1394204 r1476891 2 2 Contributors: duosecurity 3 3 Tags: authentication, two-factor, authenticator, login, username, password, duo, security 4 Requires at least: 3.04 Requires at least: 4.1 5 5 Tested up to: 4.5 6 Stable tag: 2.5. 26 Stable tag: 2.5.3 7 7 8 8 Easily add Duo Security two-factor authentication to your WordPress website. Enable two-factor authentication for your admins and/or users. … … 50 50 51 51 == Changelog == 52 53 = 2.5.3 = 54 * Update Duo-Web-v2.js 52 55 53 56 = 2.5.2 = … … 176 179 177 180 == Upgrade Notice == 181 182 = 2.5.3 = 183 * Update Duo-Web-v2.js 178 184 179 185 = 2.5.1 =
Note: See TracChangeset
for help on using the changeset viewer.