[java-identity-provider COMMIT] /trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js

noreply at shibboleth.net noreply at shibboleth.net
Fri Sep 30 22:42:30 EDT 2016


Author: scantor
Date: Fri Sep 30 22:42:29 2016
New Revision: 8443

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8443&view=rev
Log:
IDP-1013 - Login flow for Duo iframe-based authentication

https://issues.shibboleth.net/jira/browse/IDP-1013

Update Duo-Web Javascript source.

Modified:
    trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js

Modified: trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js?rev=8443&r1=8442&r2=8443&view=diff
==============================================================================
--- trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js	(original)
+++ trunk/idp-war/src/main/webapp/js/Duo-Web-v2.min.js	Fri Sep 30 22:42:29 2016
@@ -1 +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,"&v=2.1"].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);

[... 2 lines stripped ...]


More information about the commits mailing list