From 4afecb4620e925a7e9ab58670013d4b02674a2e4 Mon Sep 17 00:00:00 2001 From: Maxime Besson Date: Tue, 1 Oct 2019 11:18:20 +0200 Subject: [PATCH 01/24] Remove IDP cookie (#1941) --- .../Lemonldap/NG/Common/Conf/DefaultValues.pm | 3 +- .../Lemonldap/NG/Common/Conf/ReConstants.pm | 2 +- .../lib/Lemonldap/NG/Manager/Attributes.pm | 4 -- .../Lemonldap/NG/Manager/Build/Attributes.pm | 5 -- .../lib/Lemonldap/NG/Manager/Build/Tree.pm | 1 - .../site/htdocs/static/js/2ndfa.min.js | 2 +- .../site/htdocs/static/js/2ndfa.min.js.map | 2 +- .../site/htdocs/static/js/llApp.min.js | 2 +- .../site/htdocs/static/js/llApp.min.js.map | 2 +- .../site/htdocs/static/js/manager.min.js | 2 +- .../site/htdocs/static/js/manager.min.js.map | 2 +- .../site/htdocs/static/js/viewer.min.js | 2 +- .../site/htdocs/static/js/viewer.min.js.map | 2 +- .../site/htdocs/static/languages/ar.json | 1 - .../site/htdocs/static/languages/de.json | 1 - .../site/htdocs/static/languages/en.json | 1 - .../site/htdocs/static/languages/fr.json | 1 - .../site/htdocs/static/languages/it.json | 1 - .../site/htdocs/static/languages/vi.json | 1 - .../site/htdocs/static/languages/zh.json | 1 - .../site/htdocs/static/reverseTree.json | 2 +- .../site/htdocs/static/struct.json | 2 +- .../t/jsonfiles/01-base-tree.json | 4 -- .../02-base-tree-all-nodes-opened.json | 5 -- .../03-base-tree-appCat-modifed.json | 5 -- .../11-modified-with-confirmation.json | 5 -- .../t/jsonfiles/12-modified.json | 5 -- lemonldap-ng-manager/t/jsonfiles/14-bad.json | 5 -- .../t/jsonfiles/15-combination.json | 5 -- .../t/jsonfiles/17-extra2f.json | 5 -- lemonldap-ng-manager/t/jsonfiles/70-diff.json | 4 -- .../lib/Lemonldap/NG/Portal/Auth/CAS.pm | 1 - .../Lemonldap/NG/Portal/Auth/OpenIDConnect.pm | 1 - .../lib/Lemonldap/NG/Portal/Auth/SAML.pm | 49 ++----------------- .../lib/Lemonldap/NG/Portal/Main/Display.pm | 2 - .../site/templates/bootstrap/idpchoice.tpl | 15 ------ .../t/30-Auth-SAML-with-choice.t | 19 ++----- ...AML-Artifact-with-SOAP-SLO-IdP-initiated.t | 3 +- ...h-and-issuer-SAML-Artifact-with-SOAP-SLO.t | 11 +---- ...-Auth-and-issuer-SAML-POST-IdP-initiated.t | 4 +- ...30-Auth-and-issuer-SAML-POST-Missing-SLO.t | 16 +----- .../t/30-Auth-and-issuer-SAML-POST.t | 17 +------ ...h-and-issuer-SAML-Redirect-IdP-initiated.t | 4 +- ...uer-SAML-Redirect-MultipleSP-Missing-SLO.t | 28 ++--------- ...Auth-and-issuer-SAML-Redirect-MultipleSP.t | 28 ++--------- .../t/30-Auth-and-issuer-SAML-Redirect.t | 15 +----- lemonldap-ng-portal/t/30-CDC.t | 12 +---- .../t/30-SAML-Head-to-Tail-POST.t | 17 ++----- .../t/30-SAML-POST-Logout-when-expired.t | 14 +----- .../t/30-SAML-POST-with-2F-and-Notification.t | 11 +---- .../t/30-SAML-POST-with-Notification.t | 12 +---- .../t/30-SAML-ReAuth-with-choice.t | 20 ++------ lemonldap-ng-portal/t/30-SAML-ReAuth.t | 20 ++------ lemonldap-ng-portal/t/30-SAML-SP-rule.t | 11 +---- ...issuer-OIDC-authorization_code-OP-logout.t | 15 ------ ...er-OIDC-authorization_code-public_client.t | 3 +- ...-OIDC-authorization_code-with-authchoice.t | 3 +- ...er-OIDC-authorization_code-with-none-alg.t | 3 +- ...-Auth-and-issuer-OIDC-authorization_code.t | 3 +- .../t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t | 6 +-- .../t/37-CAS-App-to-SAML-IdP-POST.t | 6 +-- .../t/37-Logout-from-OIDC-RP-to-SAML-SP.t | 8 +-- .../t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t | 10 ++-- .../t/37-OIDC-RP-to-SAML-IdP-GET.t | 10 ++-- .../t/37-OIDC-RP-to-SAML-IdP-POST.t | 10 ++-- .../t/37-SAML-SP-GET-to-OIDC-OP.t | 2 - ...7-SAML-SP-POST-to-CAS-server-with-Choice.t | 8 +-- .../t/37-SAML-SP-POST-to-CAS-server.t | 8 +-- .../t/37-SAML-SP-POST-to-OIDC-OP.t | 2 - .../t/67-CheckUser-with-issuer-SAML-POST.t | 23 +-------- 70 files changed, 81 insertions(+), 454 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm index dfdb20c7d..d2b50b790 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm @@ -250,8 +250,7 @@ sub defaultValues { 'samlAuthnContextMapPassword' => 2, 'samlAuthnContextMapPasswordProtectedTransport' => 3, 'samlAuthnContextMapTLSClient' => 5, - 'samlEntityID' => '#PORTAL#/saml/metadata', - 'samlIdPResolveCookie' => 'lemonldapidp', + 'samlEntityID' => '#PORTAL#/saml/metadata', 'samlIDPSSODescriptorArtifactResolutionServiceArtifact' => '1;0;urn:oasis:names:tc:SAML:2.0:bindings:SOAP;#PORTAL#/saml/artifact', 'samlIDPSSODescriptorSingleLogoutServiceHTTPPost' => diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm index 5a99f629d..1e3245188 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm @@ -67,7 +67,7 @@ our $issuerParameters = { issuerDBSAML => [qw(issuerDBSAMLActivation issuerDBSAMLPath issuerDBSAMLRule)], issuerOptions => [qw(issuersTimeout)], }; -our $samlServiceParameters = [qw(samlEntityID samlServicePrivateKeySig samlServicePrivateKeySigPwd samlServicePublicKeySig samlServicePrivateKeyEnc samlServicePrivateKeyEncPwd samlServicePublicKeyEnc samlServiceUseCertificateInResponse samlServiceSignatureMethod samlNameIDFormatMapEmail samlNameIDFormatMapX509 samlNameIDFormatMapWindows samlNameIDFormatMapKerberos samlAuthnContextMapPassword samlAuthnContextMapPasswordProtectedTransport samlAuthnContextMapTLSClient samlAuthnContextMapKerberos samlOrganizationDisplayName samlOrganizationName samlOrganizationURL samlSPSSODescriptorAuthnRequestsSigned samlSPSSODescriptorWantAssertionsSigned samlSPSSODescriptorSingleLogoutServiceHTTPRedirect samlSPSSODescriptorSingleLogoutServiceHTTPPost samlSPSSODescriptorSingleLogoutServiceSOAP samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact samlSPSSODescriptorAssertionConsumerServiceHTTPPost samlSPSSODescriptorArtifactResolutionServiceArtifact samlIDPSSODescriptorWantAuthnRequestsSigned samlIDPSSODescriptorSingleSignOnServiceHTTPRedirect samlIDPSSODescriptorSingleSignOnServiceHTTPPost samlIDPSSODescriptorSingleSignOnServiceHTTPArtifact samlIDPSSODescriptorSingleLogoutServiceHTTPRedirect samlIDPSSODescriptorSingleLogoutServiceHTTPPost samlIDPSSODescriptorSingleLogoutServiceSOAP samlIDPSSODescriptorArtifactResolutionServiceArtifact samlAttributeAuthorityDescriptorAttributeServiceSOAP samlIdPResolveCookie samlMetadataForceUTF8 samlStorage samlStorageOptions samlRelayStateTimeout samlUseQueryStringSpecific samlCommonDomainCookieActivation samlCommonDomainCookieDomain samlCommonDomainCookieReader samlCommonDomainCookieWriter samlDiscoveryProtocolActivation samlDiscoveryProtocolURL samlDiscoveryProtocolPolicy samlDiscoveryProtocolIsPassive samlOverrideIDPEntityID)]; +our $samlServiceParameters = [qw(samlEntityID samlServicePrivateKeySig samlServicePrivateKeySigPwd samlServicePublicKeySig samlServicePrivateKeyEnc samlServicePrivateKeyEncPwd samlServicePublicKeyEnc samlServiceUseCertificateInResponse samlServiceSignatureMethod samlNameIDFormatMapEmail samlNameIDFormatMapX509 samlNameIDFormatMapWindows samlNameIDFormatMapKerberos samlAuthnContextMapPassword samlAuthnContextMapPasswordProtectedTransport samlAuthnContextMapTLSClient samlAuthnContextMapKerberos samlOrganizationDisplayName samlOrganizationName samlOrganizationURL samlSPSSODescriptorAuthnRequestsSigned samlSPSSODescriptorWantAssertionsSigned samlSPSSODescriptorSingleLogoutServiceHTTPRedirect samlSPSSODescriptorSingleLogoutServiceHTTPPost samlSPSSODescriptorSingleLogoutServiceSOAP samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact samlSPSSODescriptorAssertionConsumerServiceHTTPPost samlSPSSODescriptorArtifactResolutionServiceArtifact samlIDPSSODescriptorWantAuthnRequestsSigned samlIDPSSODescriptorSingleSignOnServiceHTTPRedirect samlIDPSSODescriptorSingleSignOnServiceHTTPPost samlIDPSSODescriptorSingleSignOnServiceHTTPArtifact samlIDPSSODescriptorSingleLogoutServiceHTTPRedirect samlIDPSSODescriptorSingleLogoutServiceHTTPPost samlIDPSSODescriptorSingleLogoutServiceSOAP samlIDPSSODescriptorArtifactResolutionServiceArtifact samlAttributeAuthorityDescriptorAttributeServiceSOAP samlMetadataForceUTF8 samlStorage samlStorageOptions samlRelayStateTimeout samlUseQueryStringSpecific samlCommonDomainCookieActivation samlCommonDomainCookieDomain samlCommonDomainCookieReader samlCommonDomainCookieWriter samlDiscoveryProtocolActivation samlDiscoveryProtocolURL samlDiscoveryProtocolPolicy samlDiscoveryProtocolIsPassive samlOverrideIDPEntityID)]; our $oidcServiceParameters = [qw(oidcServiceMetaDataIssuer oidcServiceMetaDataAuthorizeURI oidcServiceMetaDataTokenURI oidcServiceMetaDataUserInfoURI oidcServiceMetaDataJWKSURI oidcServiceMetaDataRegistrationURI oidcServiceMetaDataIntrospectionURI oidcServiceMetaDataEndSessionURI oidcServiceMetaDataCheckSessionURI oidcServiceMetaDataFrontChannelURI oidcServiceMetaDataBackChannelURI oidcServiceMetaDataAuthnContext oidcServicePrivateKeySig oidcServicePublicKeySig oidcServiceKeyIdSig oidcServiceAllowDynamicRegistration oidcServiceAllowAuthorizationCodeFlow oidcServiceAllowImplicitFlow oidcServiceAllowHybridFlow oidcStorage oidcStorageOptions)]; 1; diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 547fff7e0..29d41b1f3 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -2988,10 +2988,6 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] }, 'type' => 'file' }, - 'samlIdPResolveCookie' => { - 'default' => 'lemonldapidp', - 'type' => 'text' - }, 'samlIDPSSODescriptorArtifactResolutionServiceArtifact' => { 'default' => '1;0;urn:oasis:names:tc:SAML:2.0:bindings:SOAP;#PORTAL#/saml/artifact', diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index aef8cbd1a..9d652e6f5 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -2255,11 +2255,6 @@ sub attributes { documentation => 'Use certificate instead of public key in SAML responses', }, - samlIdPResolveCookie => { - type => 'text', - default => 'lemonldapidp', - documentation => 'SAML IDP resolution cookie', - }, samlMetadataForceUTF8 => { default => 1, type => 'bool', diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm index 81f699a10..82f5a332b 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm @@ -1097,7 +1097,6 @@ sub tree { title => 'samlAdvanced', help => 'samlservice.html#advanced', nodes => [ - 'samlIdPResolveCookie', 'samlMetadataForceUTF8', 'samlStorage', 'samlStorageOptions', diff --git a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js index f5b155d2c..6c2fdba0f 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/2ndfa.min.js @@ -1 +1 @@ -(function(){var C,o,f,g,e;e=function(e,t){return $("#msg").html(window.translate(e)),$("#color").removeClass("message-positive message-warning alert-success alert-warning"),$("#color").addClass("message-"+t),"positive"===t&&(t="success"),$("#color").addClass("alert-"+t)},g={_whatToTrace:[function(e,t){return"groupBy=substr("+e+",1)"},function(e,t){return e+"="+t+"*"}]},f={_whatToTrace:function(e,t,n,a){return console.log("overSchema => level",n,"over",a),1===n&&t.length>a?e+"="+t+"*&groupBy=substr("+e+","+(n+a+1)+")":null}},C={dateTitle:["_utime","_startTime","_updateTime"],sfaTitle:["_2fDevices"]},o={home:[]},angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]).controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(k,t,e,n,a){var p,r,i,d;return k.links=links,k.menulinks=menulinks,k.staticPrefix=staticPrefix,k.scriptname=scriptname,k.formPrefix=formPrefix,k.availableLanguages=availableLanguages,k.waiting=!0,k.showM=!1,k.showT=!0,k.data=[],k.currentScope=null,k.currentSession=null,k.menu=o,k.searchString="",k.U2FCheck="1",k.TOTPCheck="1",k.UBKCheck="1",k.translateP=t.translateP,k.translate=t.translate,k.translateTitle=function(e){return t.translateField(e,"title")},d="persistent",k.menuClick=function(e){if(e.popup)window.open(e.popup);else switch(e.action||(e.action=e.title),typeof e.action){case"function":e.action(k.currentNode,k),k[e.action]();break;case"string":k[e.action]();break;default:console.log(typeof e.action)}return k.showM=!1},k.search2FA=function(e){return e&&(k.searchString=""),k.currentSession=null,k.data=[],k.updateTree2("",k.data,0,0)},k.delete2FA=function(e,t){return angular.element(".data-"+t).remove(),k.waiting=!0,a.delete(scriptname+"sfa/"+d+"/"+k.currentSession.id+"?type="+e+"&epoch="+t).then(function(e){return k.waiting=!1},function(e){return k.waiting=!1}),k.showT=!1},k.stoggle=function(e){var t;return 0===(t=e.$modelValue).nodes.length&&k.updateTree(t.value,t.nodes,t.level,t.over,t.query,t.count),e.toggle()},k.displaySession=function(e){var t,n;return n=function(o){var e,t,n,a,r,i,s,u,l,c,h,p,d,f,g,m,T,w,v,y,_;for(h in e=function(e){return e},function(e,t){var n,a,r,i;for(n in r=[],a=new RegExp(e),o)i=o[n],n.match(a)&&i&&(r.push({title:n,value:i}),delete o[n]);if(0 level",n,"over",a),1===n&&t.length>a?e+"="+t+"*&groupBy=substr("+e+","+(n+a+1)+")":null}},C={dateTitle:["_utime","_startTime","_updateTime"],sfaTitle:["_2fDevices"]},o={home:[]},angular.module("llngSessionsExplorer",["ui.tree","ui.bootstrap","llApp"]).controller("SessionsExplorerCtrl",["$scope","$translator","$location","$q","$http",function(k,t,e,n,a){var p,r,i,d;return k.links=links,k.menulinks=menulinks,k.staticPrefix=staticPrefix,k.scriptname=scriptname,k.formPrefix=formPrefix,k.availableLanguages=availableLanguages,k.waiting=!0,k.showM=!1,k.showT=!0,k.data=[],k.currentScope=null,k.currentSession=null,k.menu=o,k.searchString="",k.U2FCheck="1",k.TOTPCheck="1",k.UBKCheck="1",k.translateP=t.translateP,k.translate=t.translate,k.translateTitle=function(e){return t.translateField(e,"title")},d="persistent",k.menuClick=function(e){if(e.popup)window.open(e.popup);else switch(e.action||(e.action=e.title),typeof e.action){case"function":e.action(k.currentNode,k),k[e.action]();break;case"string":k[e.action]();break;default:console.log(typeof e.action)}return k.showM=!1},k.search2FA=function(e){return e&&(k.searchString=""),k.currentSession=null,k.data=[],k.updateTree2("",k.data,0,0)},k.delete2FA=function(e,t){return angular.element(".data-"+t).remove(),k.waiting=!0,a.delete(scriptname+"sfa/"+d+"/"+k.currentSession.id+"?type="+e+"&epoch="+t).then(function(e){return k.waiting=!1},function(e){return k.waiting=!1}),k.showT=!1},k.stoggle=function(e){var t;return 0===(t=e.$modelValue).nodes.length&&k.updateTree(t.value,t.nodes,t.level,t.over,t.query,t.count),e.toggle()},k.displaySession=function(e){var t,n;return n=function(o){var e,t,n,a,r,i,s,u,l,c,h,p,d,f,g,m,T,w,v,y,_;for(h in e=function(e){return e},function(e,t){var n,a,r,i;for(n in r=[],a=new RegExp(e),o)i=o[n],n.match(a)&&i&&(r.push({title:n,value:i}),delete o[n]);if(0",g.lang),g.deferredTr=[],g.translationFields={},g.translate=function(e){return g.translationFields[e]&&(e=g.translationFields[e]),e},g.translateField=function(e,t){return g.translate(e[t])},g.translateP=function(e){return e&&g.translationFields.portal&&(e=e.replace(/__(\w+)__/g,function(e,t){return g.translate(t)})),e},this.$get=["$q","$http",function(t,n){return g.last="",g.init=function(e){var i;return e=e||g.lang,(i=new Date).setTime(i.getTime()+2592e6),document.cookie="llnglanguage="+e+"; expires="+i.toUTCString()+"; path=/",i=t.defer(),g.last!==e?(g.last=e,n.get(window.staticPrefix+"languages/"+e+".json").then(function(e){var t,n,r,a;for(g.translationFields=e.data,n=0,r=(a=g.deferredTr).length;nr.resizerMax&&(t=parseInt(r.resizerMax)),$(r.resizerLeft).css({width:t+"px"}),$(r.resizerRight).css({width:s-t+"px"})):(n=e.pageY-$("#navbar").height(),$(r.resizerTop).css({height:n+"px"}),$(r.resizerBottom).css({height:o-n+"px"}))},a=function(){return i.unbind("mousemove",n),i.unbind("mouseup",a)}}}]),e.factory("$lmhttp",["$q","$location",function(t,e){return{responseError:function(e){return 401===e.status&&window.portal?window.location=window.portal+"?url="+window.btoa(window.location).replace(/\//,"_"):t.reject(e)}}}]),e.config(["$httpProvider",function(e){return e.interceptors.push("$lmhttp")}])}).call(this); \ No newline at end of file +(function(){var e;(e=angular.module("llApp",["ngAria"])).provider("$translator",function(){var e,t,n,r,a,i,o,s,l,u,c,g;if(g={},decodeURIComponent(document.cookie).match(/llnglanguage=(\w+)/))g.lang=RegExp.$1;else if(navigator){for(r=[],a=[],l=[navigator.language],navigator.languages&&(l=navigator.languages),t=0,i=l.length;t",g.lang),g.deferredTr=[],g.translationFields={},g.translate=function(e){return g.translationFields[e]&&(e=g.translationFields[e]),e},g.translateField=function(e,t){return g.translate(e[t])},g.translateP=function(e){return e&&g.translationFields.portal&&(e=e.replace(/__(\w+)__/g,function(e,t){return g.translate(t)})),e},this.$get=["$q","$http",function(t,n){return g.last="",g.init=function(e){var i;return e||(e=g.lang),(i=new Date).setTime(i.getTime()+2592e6),document.cookie="llnglanguage="+e+"; expires="+i.toUTCString()+"; path=/",i=t.defer(),g.last!==e?(g.last=e,n.get(window.staticPrefix+"languages/"+e+".json").then(function(e){var t,n,r,a;for(g.translationFields=e.data,n=0,r=(a=g.deferredTr).length;nr.resizerMax&&(t=parseInt(r.resizerMax)),$(r.resizerLeft).css({width:t+"px"}),$(r.resizerRight).css({width:s-t+"px"})):(n=e.pageY-$("#navbar").height(),$(r.resizerTop).css({height:n+"px"}),$(r.resizerBottom).css({height:o-n+"px"}))},a=function(){return i.unbind("mousemove",n),i.unbind("mouseup",a)}}}]),e.factory("$lmhttp",["$q","$location",function(t,e){return{responseError:function(e){return 401===e.status&&window.portal?window.location=window.portal+"?url="+window.btoa(window.location).replace(/\//,"_"):t.reject(e)}}}]),e.config(["$httpProvider",function(e){return e.interceptors.push("$lmhttp")}])}).call(this); \ No newline at end of file diff --git a/lemonldap-ng-manager/site/htdocs/static/js/llApp.min.js.map b/lemonldap-ng-manager/site/htdocs/static/js/llApp.min.js.map index 4ba3970d1..bf405e91d 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/llApp.min.js.map +++ b/lemonldap-ng-manager/site/htdocs/static/js/llApp.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["lemonldap-ng-manager/site/htdocs/static/js/llApp.js"],"names":["llapp","angular","module","provider","al","j","k","langs","langs2","len","len1","nl","nlangs","re","ref","res","decodeURIComponent","document","cookie","match","lang","RegExp","$1","navigator","language","languages","length","console","log","window","availableLanguages","push","substring","deferredTr","translationFields","translate","s","translateField","node","field","translateP","portal","replace","w","this","$get","$q","$http","last","init","d","Date","setTime","getTime","toUTCString","defer","get","staticPrefix","then","response","h","l","len2","ref1","data","e","f","m","resolve","reject","promise","directive","$translator","restrict","transclude","scope","trspan","link","elem","attr","text","template","params","set","key","obj","menu","$htmlParams","terminal","compile","element","t","type","JSON","parse","error","controller","$scope","$uibModalInstance","currentNode","oldValue","result","ok","close","cancel","dismiss","inSelect","value","select","$parse","attrs","fn","onReadFile","on","onChangeEvent","reader","FileReader","onload","onLoadEvent","$apply","$fileContent","target","readAsText","srcElement","files","$document","hsize","rsize","$element","$attrs","mousemove","mouseup","event","resizer","$","resizerRight","width","resizerLeft","resizerTop","height","resizerBottom","preventDefault","x","y","pageX","resizerMax","parseInt","css","pageY","unbind","factory","$location","responseError","rejection","status","location","btoa","config","$httpProvider","interceptors","call"],"mappings":"CAaA,WACE,IAAIA,GAEJA,EAAQC,QAAQC,OAAO,QAAS,CAAC,YAE3BC,SAAS,cAAe,WAC5B,IAAIC,EAAOC,EAAGC,EAAGC,EAAOC,EAAQC,EAAKC,EAAMC,EAAIC,EAAQC,EAAIC,EAAKC,EAGhE,GAFAA,EAAM,GACFC,mBAAmBC,SAASC,QAC1BC,MAAM,sBACVJ,EAAIK,KAAOC,OAAOC,QACb,GAAIC,UAAW,CAOpB,IANAhB,EAAQ,GACRC,EAAS,GACTI,EAAS,CAACW,UAAUC,UAChBD,UAAUE,YACZb,EAASW,UAAUE,WAEhBpB,EAAI,EAAGI,EAAMG,EAAOc,OAAQrB,EAAII,EAAKJ,IAIxC,IAHAM,EAAKC,EAAOP,GACZsB,QAAQC,IAAI,iBAAkBjB,GAEzBL,EAAI,EAAG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AAK,gBAI1CiI,KAAKpH"} \ No newline at end of file +{"version":3,"sources":["lemonldap-ng-manager/site/htdocs/static/js/llApp.js"],"names":["llapp","angular","module","provider","al","j","k","langs","langs2","len","len1","nl","nlangs","re","ref","res","decodeURIComponent","document","cookie","match","lang","RegExp","$1","navigator","language","languages","length","console","log","window","availableLanguages","push","substring","deferredTr","translationFields","translate","s","translateField","node","field","translateP","portal","replace","w","this","$get","$q","$http","last","init","d","Date","setTime","getTime","toUTCString","defer","get","staticPrefix","then","response","h","l","len2","ref1","data","e","f","m","resolve","reject","promise","directive","$translator","restrict","transclude","scope","trspan","link","elem","attr","text","template","params","set","key","obj","menu","$htmlParams","terminal","compile","element","t","type","JSON","parse","error","controller","$scope","$uibModalInstance","currentNode","oldValue","result","ok","close","cancel","dismiss","inSelect","value","select","$parse","attrs","fn","onReadFile","on","onChangeEvent","reader","FileReader","onload","onLoadEvent","$apply","$fileContent","target","readAsText","srcElement","files","$document","hsize","rsize","$element","$attrs","mousemove","mouseup","event","resizer","$","resizerRight","width","resizerLeft","resizerTop","height","resizerBottom","preventDefault","x","y","pageX","resizerMax","parseInt","css","pageY","unbind","factory","$location","responseError","rejection","status","location","btoa","config","$httpProvider","interceptors","call"],"mappings":"CAaA,WACE,IAAIA,GAEJA,EAAQC,QAAQC,OAAO,QAAS,CAAC,YAE3BC,SAAS,cAAe,WAC5B,IAAIC,EAAOC,EAAGC,EAAGC,EAAOC,EAAQC,EAAKC,EAAMC,EAAIC,EAAQC,EAAIC,EAAKC,EAGhE,GAFAA,EAAM,GACFC,mBAAmBC,SAASC,QAC1BC,MAAM,sBACVJ,EAAIK,KAAOC,OAAOC,QACb,GAAIC,UAAW,CAOpB,IANAhB,EAAQ,GACRC,EAAS,GACTI,EAAS,CAACW,UAAUC,UAChBD,UAAUE,YACZb,EAASW,UAAUE,WAEhBpB,EAAI,EAAGI,EAAMG,EAAOc,OAAQrB,EAAII,EAAKJ,IAIxC,IAHAM,EAAKC,EAAOP,GACZsB,Q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gBAAiB,SAASC,GACxB,OAAOA,EAAcC,aAAahI,KAAK,gBAI1CiI,KAAKpH"} \ No newline at end of file diff --git a/lemonldap-ng-manager/site/htdocs/static/js/manager.min.js b/lemonldap-ng-manager/site/htdocs/static/js/manager.min.js index 43f63c20e..a7d796044 100644 --- a/lemonldap-ng-manager/site/htdocs/static/js/manager.min.js +++ b/lemonldap-ng-manager/site/htdocs/static/js/manager.min.js @@ -1 +1 @@ -(function(){angular.module("llngManager",["ui.tree","ui.bootstrap","llApp","ngCookies"]).controller("TreeCtrl",["$scope","$http","$location","$q","$uibModal","$translator","$cookies","$htmlParams",function(f,u,a,l,o,n,r,e){var t,s,d,c,p,i,m,g,h;return f.links=window.links,f.menu=e.menu,f.menulinks=window.menulinks,f.staticPrefix=window.staticPrefix,f.formPrefix=window.formPrefix,f.availableLanguages=window.availableLanguages,f.waiting=!0,f.showM=!1,f.showT=!1,f.form="home",f.currentCfg={},f.confPrefix=window.confPrefix,f.message={},f.result="",f.translateTitle=function(e){return n.translateField(e,"title")},f.translateP=n.translateP,f.translate=n.translate,f.helpUrl="start.html#configuration",f.setShowHelp=function(e){var t;return null==e&&(e=!f.showH),f.showH=e,(t=new Date(Date.now())).setFullYear(t.getFullYear()+1),r.put("showhelp",e?"true":"false",{expires:t})},f.showH="false"!==r.get("showhelp"),null==f.showH&&f.setShowHelp(!0),m=function(e){var t,n;return t=e.status,n=e.statusLine,f.waiting=!1,403===t?f.message={title:"forbidden",message:"",items:[]}:401===t?(console.log("Authentication needed"),f.message={title:"authenticationNeeded",message:"__waitOrF5__",items:[]}):f.message=400===t?{title:"badRequest",message:n,items:[]}:0data->{list} = $self->srvList; - $req->data->{confirmRemember} = 0; $req->data->{login} = 1; return PE_IDPCHOICE; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/OpenIDConnect.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/OpenIDConnect.pm index 4c12affdc..e9ecd6b23 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/OpenIDConnect.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/OpenIDConnect.pm @@ -244,7 +244,6 @@ sub extractFormInfo { $portalPath =~ s#^https?://[^/]+/?#/#; $req->data->{list} = $self->opList; - $req->data->{confirmRemember} = 0; $req->data->{login} = 1; return PE_IDPCHOICE; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SAML.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SAML.pm index 6292f57c9..4fda09a9b 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SAML.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SAML.pm @@ -859,7 +859,7 @@ sub extractFormInfo { # 2. IDP resolution # Search a selected IdP - my ( $idp, $idp_cookie ) = $self->getIDP($req); + my $idp = $self->getIDP($req); # Use Common Domain Cookie if ( !$idp @@ -973,47 +973,12 @@ sub extractFormInfo { or $a->{val} cmp $b->{val} } @list; $req->data->{list} = \@list; - $req->data->{confirmRemember} = 1; - - # Delete existing IDP resolution cookie - $req->addCookie( - $self->p->cookie( - name => $self->conf->{samlIdPResolveCookie}, - value => 0, - domain => $self->conf->{domain}, - secure => 0, - expires => 'Wed, 21 Oct 2015 00:00:00 GMT', - ) - ); #TODO: check this $req->data->{login} = 1; return PE_IDPCHOICE; } - # Store choosen IDP in cookie - unless ( $idp_cookie and $idp eq $idp_cookie ) { - $self->logger->debug("Build cookie to remember $idp as IDP choice"); - - # Control url parameter - my $urlcheck = $self->p->controlUrl($req); - return $urlcheck unless ( $urlcheck == PE_OK ); - - # User can choose temporary (0) or persistent cookie (1) - my $cookie_type = $req->param("cookie_type") || "0"; - - # Cookie available 1 year - $req->addCookie( - $self->p->cookie( - name => $self->conf->{samlIdPResolveCookie}, - value => $idp, - domain => $self->conf->{domain}, - secure => $self->conf->{securedCookie}, - ( $cookie_type ? ( max_age => 31557600 ) : () ), - ) - ); - } - # 3. Build authentication request # IDP conf key @@ -1487,7 +1452,6 @@ sub getDisplayType { # Try to find an IdP using : # * HTTP parameter -# * "samlIdPResolveCookie" cookie # * Rules # # @return Array containing : @@ -1498,8 +1462,6 @@ sub getIDP { my $idp; my $idpName; - my $idp_cookie = $req->cookies->{ $self->{conf}->{samlIdPResolveCookie} }; - # Case 1: Recover IDP from idp URL Parameter unless ( $idp = $req->param("idp") ) { @@ -1516,12 +1478,7 @@ sub getIDP { } } - # Case 3: Recover IDP from cookie - if ( !$idp and $idp = $idp_cookie ) { - $self->logger->debug("IDP $idp selected from IDP resolution cookie"); - } - - # Case 4: check all IDP resolution rules + # Case 3: check all IDP resolution rules # The first match win else { foreach ( keys %{ $self->idpList } ) { @@ -1553,7 +1510,7 @@ sub getIDP { $idp = undef; } - return ( $idp, $idp_cookie ); + return $idp; } 1; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm index 86edf43d8..d1a417f70 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -83,7 +83,6 @@ sub display { && $req->data->{login}, ASK_LOGINS => $req->param('checkLogins') || 0, CONFIRMKEY => $self->stamp(), - REMEMBER => $req->data->{confirmRemember}, ( $req->data->{customScript} ? ( CUSTOM_SCRIPT => $req->data->{customScript} ) @@ -113,7 +112,6 @@ sub display { ASK_LOGINS => $req->param('checkLogins') || 0, CONFIRMKEY => $self->stamp(), LIST => $req->data->{list} || [], - REMEMBER => $req->data->{confirmRemember}, ( $req->data->{customScript} ? ( CUSTOM_SCRIPT => $req->data->{customScript} ) diff --git a/lemonldap-ng-portal/site/templates/bootstrap/idpchoice.tpl b/lemonldap-ng-portal/site/templates/bootstrap/idpchoice.tpl index c7754181e..f5c6aaf80 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/idpchoice.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/idpchoice.tpl @@ -42,21 +42,6 @@ - -
-
-
- -
-
-

- -

-
-
- diff --git a/lemonldap-ng-portal/t/30-Auth-SAML-with-choice.t b/lemonldap-ng-portal/t/30-Auth-SAML-with-choice.t index 021db61bf..e5070ebd8 100644 --- a/lemonldap-ng-portal/t/30-Auth-SAML-with-choice.t +++ b/lemonldap-ng-portal/t/30-Auth-SAML-with-choice.t @@ -12,7 +12,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 24; +my $maintests = 22; my $debug = 'error'; my %handlerOR = ( issuer => [], sp => [] ); @@ -60,9 +60,6 @@ SKIP: { ), 'Post SAML choice' ); - ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' ) - or explain( $res->[1], - 'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' ); ( $host, $url, $query ) = expectForm( $res, undef, undef, 'confirm', ); # IDP must be sorted @@ -92,16 +89,11 @@ m% IO::String->new($query), accept => 'text/html', length => length($query), - cookie => "lemonldapidp=0;$spPdata", + cookie => "$spPdata", ), 'Post SAML choice' ); $spPdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $query ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -144,7 +136,7 @@ m%new($query), accept => 'text/html', length => length($query), - cookie => "lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata", + cookie => "$spPdata", ), 'Post SAML response to SP' ); @@ -194,7 +186,6 @@ m%new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -213,9 +204,7 @@ m%_get( - '/', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + '/', cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t index bce086c9b..f1f4d3d05 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t @@ -149,8 +149,7 @@ m#img src="http://auth.idp.com(/saml/relaySingleLogoutSOAP)\?(relay=.*?)"#s, $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t index 1f0b21045..b69808762 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t @@ -10,7 +10,7 @@ BEGIN { require 't/test-lib.pm'; } -my $maintests = 14; +my $maintests = 13; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -65,11 +65,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOnArtifact)\?(SAMLart=.+)# ); @@ -121,7 +116,6 @@ SKIP: { query => $query, accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Push artifact to SP' ); @@ -174,8 +168,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t index 9a82d55a9..95844c8ee 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t @@ -74,7 +74,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -180,8 +179,7 @@ m#iframe src="http://auth.idp.com(/saml/relaySingleLogoutPOST)\?(relay=.*?)"#s, $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-Missing-SLO.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-Missing-SLO.t index 5b51a49b4..c391759c3 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-Missing-SLO.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST-Missing-SLO.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 21; +my $maintests = 19; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -50,11 +50,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -96,11 +91,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -142,7 +132,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -210,8 +199,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t index 361826e4b..5f2c26471 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-POST.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 22; +my $maintests = 20; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -50,11 +50,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -96,11 +91,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -148,7 +138,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -206,7 +195,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -227,8 +215,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t index d544abd93..7daeccc4d 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t @@ -84,7 +84,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -162,8 +161,7 @@ m#iframe src="http://auth.sp.com(/saml/proxySingleLogout)\?(SAMLRequest=.*?)"#, $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t index a1c5befa4..f1ba443dd 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 23; +my $maintests = 21; my $debug = 'error'; my ( $issuer, $sp, $sp2, $res ); my %handlerOR = ( issuer => [], sp => [], sp2 => [] ); @@ -55,15 +55,6 @@ SKIP: { 'Unauth SP request' ); my ( $host, $url, $query ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); @@ -113,7 +104,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -144,15 +134,6 @@ SKIP: { 'Unauth SP2 request' ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp2.com; path=/' - ); ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); @@ -178,7 +159,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP2' ); @@ -235,8 +215,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); @@ -249,8 +228,7 @@ SKIP: { $res = $sp2->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$sp2Id" + cookie => "lemonldap=$sp2Id" ), 'User is unfortunately still logged into SP2' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP.t index 34dc2c45b..d116e1e38 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect-MultipleSP.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 27; +my $maintests = 25; my $debug = 'error'; my ( $issuer, $sp, $sp2, $res ); my %handlerOR = ( issuer => [], sp => [], sp2 => [] ); @@ -55,15 +55,6 @@ SKIP: { 'Unauth SP request' ); my ( $host, $url, $query ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); @@ -113,7 +104,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -144,15 +134,6 @@ SKIP: { 'Unauth SP2 request' ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp2.com; path=/' - ); ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); @@ -178,7 +159,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP2' ); @@ -293,8 +273,7 @@ qr#^http://auth.sp.com(/saml/proxySingleLogoutReturn)\?(SAMLResponse=.+)# $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); @@ -306,8 +285,7 @@ qr#^http://auth.sp.com(/saml/proxySingleLogoutReturn)\?(SAMLResponse=.+)# $res = $sp2->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$sp2Id" + cookie => "lemonldap=$sp2Id" ), 'Test if user is reject on SP2' ); diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t index e86d9b06e..d8bafda2f 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Redirect.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 17; +my $maintests = 16; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -52,15 +52,6 @@ SKIP: { 'Unauth SP request' ); my ( $host, $url, $query ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); @@ -115,7 +106,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -189,8 +179,7 @@ qr#^http://auth.sp.com(/saml/proxySingleLogoutReturn)\?(SAMLResponse=.+)# $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-CDC.t b/lemonldap-ng-portal/t/30-CDC.t index 86d1ca1ae..e3ff6dc32 100644 --- a/lemonldap-ng-portal/t/30-CDC.t +++ b/lemonldap-ng-portal/t/30-CDC.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 21; +my $maintests = 20; my $debug = 'error'; my ( $issuer, $sp, $cdc, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -63,11 +63,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -126,7 +121,6 @@ m#new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -184,7 +178,6 @@ m#new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -205,8 +198,7 @@ m#_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-Head-to-Tail-POST.t b/lemonldap-ng-portal/t/30-SAML-Head-to-Tail-POST.t index 19d22203f..cde45d6bc 100644 --- a/lemonldap-ng-portal/t/30-SAML-Head-to-Tail-POST.t +++ b/lemonldap-ng-portal/t/30-SAML-Head-to-Tail-POST.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 13; +my $maintests = 12; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -49,11 +49,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -96,7 +91,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -109,9 +103,8 @@ SKIP: { ok( $res = $sp->_get( $url || '/', - query => $s, - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId", + query => $s, + cookie => "lemonldap=$spId", accept => 'text/html', ), ' Follow redirection' @@ -155,7 +148,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -176,8 +168,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-POST-Logout-when-expired.t b/lemonldap-ng-portal/t/30-SAML-POST-Logout-when-expired.t index 4ca0bb350..6af1a1063 100644 --- a/lemonldap-ng-portal/t/30-SAML-POST-Logout-when-expired.t +++ b/lemonldap-ng-portal/t/30-SAML-POST-Logout-when-expired.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 18; +my $maintests = 16; my $debug = 'error'; my $timeout = 6; my ( $issuer, $sp, $res ); @@ -51,11 +51,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -97,11 +92,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -148,7 +138,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -201,7 +190,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-POST-with-2F-and-Notification.t b/lemonldap-ng-portal/t/30-SAML-POST-with-2F-and-Notification.t index c4db45d3f..15ce76204 100644 --- a/lemonldap-ng-portal/t/30-SAML-POST-with-2F-and-Notification.t +++ b/lemonldap-ng-portal/t/30-SAML-POST-with-2F-and-Notification.t @@ -12,7 +12,7 @@ BEGIN { require 't/smtp.pm'; } -my $maintests = 20; +my $maintests = 19; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -65,11 +65,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -172,7 +167,6 @@ qr% [], sp => [] ); @@ -64,11 +64,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -144,7 +139,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -194,7 +188,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -215,8 +208,7 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t b/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t index 08fbdca6b..f710f0522 100644 --- a/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t +++ b/lemonldap-ng-portal/t/30-SAML-ReAuth-with-choice.t @@ -12,7 +12,7 @@ BEGIN { } my $userdb = tempdb(); -my $maintests = 13; +my $maintests = 12; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -75,11 +75,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $query ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -92,8 +87,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => - "lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata", + cookie => "lemonldap=$idpId", ), 'Post SAML request to IdP' ); @@ -108,8 +102,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Ask to renew' ); @@ -127,8 +120,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Re auth' ); @@ -143,8 +135,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Follow redirection' ); @@ -159,7 +150,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-ReAuth.t b/lemonldap-ng-portal/t/30-SAML-ReAuth.t index 2a4157937..b8dcc263d 100644 --- a/lemonldap-ng-portal/t/30-SAML-ReAuth.t +++ b/lemonldap-ng-portal/t/30-SAML-ReAuth.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 13; +my $maintests = 12; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -63,11 +63,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $query ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -80,8 +75,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => - "lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata", + cookie => "lemonldap=$idpId", ), 'Post SAML request to IdP' ); @@ -96,8 +90,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Ask to renew' ); @@ -115,8 +108,7 @@ SKIP: { IO::String->new($query), accept => 'text/html', length => length($query), - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Re auth' ); @@ -131,8 +123,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$idpId;lemonldapidp=http://auth.idp.com/saml/metadata;$pdata", + cookie => "lemonldap=$idpId;$pdata", ), 'Follow redirection' ); @@ -147,7 +138,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/30-SAML-SP-rule.t b/lemonldap-ng-portal/t/30-SAML-SP-rule.t index ba267dfd0..bfa9382f7 100644 --- a/lemonldap-ng-portal/t/30-SAML-SP-rule.t +++ b/lemonldap-ng-portal/t/30-SAML-SP-rule.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 7; +my $maintests = 6; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -51,15 +51,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( - expectCookie( $res, 'lemonldapidp' ) eq - 'http://auth.idp.com/saml/metadata', - 'IDP cookie defined' - ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $url, $query ) = expectRedirection( $res, qr#^http://auth.idp.com(/saml/singleSignOn)\?(SAMLRequest=.+)# ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t index 9335727c6..6b8cd7705 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-OP-logout.t @@ -186,21 +186,6 @@ ok( count(1); expectReject($res); -#switch ('rp'); -#ok( -# $res = $rp->_get( -# '/', -# accept => 'text/html', -# cookie => -# "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" -# ), -# 'Test if user is reject on SP' -#); -#count(1); -#expectRedirection( $res, qr#^http://auth.op.com/oauth2/authorize# ); - -#print STDERR Dumper($res); - clean_sessions(); done_testing( count() ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-public_client.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-public_client.t index e07960127..3d7dfa7e1 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-public_client.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-public_client.t @@ -261,8 +261,7 @@ ok( $res = $rp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t index 185cd20e2..94b8d55ea 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-authchoice.t @@ -228,8 +228,7 @@ SKIP: { $res = $rp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t index eefe11470..4c6511e6f 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code-with-none-alg.t @@ -261,8 +261,7 @@ ok( $res = $rp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t index e248df11e..058cf3fb3 100644 --- a/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t +++ b/lemonldap-ng-portal/t/32-Auth-and-issuer-OIDC-authorization_code.t @@ -261,8 +261,7 @@ ok( $res = $rp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t b/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t index 879ceac0a..d61a2f227 100644 --- a/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t +++ b/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t @@ -167,8 +167,7 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata;$proxyPdata", + cookie => "$proxyPdata", ), 'POST SAML response' ); @@ -178,8 +177,7 @@ SKIP: { $res = $proxy->_get( $url, accept => 'text/html', - cookie => -"lemonldapidp=http://auth.idp.com/saml/metadata;lemonldap=$spId;$proxyPdata", + cookie => "lemonldap=$spId;$proxyPdata", ), 'Follow internal redirection' ); diff --git a/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST.t b/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST.t index bb7a7a863..efb60f67c 100644 --- a/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST.t +++ b/lemonldap-ng-portal/t/37-CAS-App-to-SAML-IdP-POST.t @@ -152,8 +152,7 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata;$proxyPdata", + cookie => "$proxyPdata", ), 'POST SAML response' ); @@ -163,8 +162,7 @@ SKIP: { $res = $proxy->_get( $url, accept => 'text/html', - cookie => -"lemonldapidp=http://auth.idp.com/saml/metadata;lemonldap=$spId;$proxyPdata", + cookie => "lemonldap=$spId;$proxyPdata", ), 'Follow internal redirection' ); diff --git a/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t b/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t index e18673753..313f352ae 100644 --- a/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t +++ b/lemonldap-ng-portal/t/37-Logout-from-OIDC-RP-to-SAML-SP.t @@ -167,7 +167,6 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => 'lemonldapidp=http://auth.op.com/saml/metadata' ), 'Try SAML SP' ); @@ -197,7 +196,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -305,8 +303,7 @@ m#iframe src="http://auth.op.com(/saml/relaySingleLogoutPOST)\?(relay=.*?)"#s, $res = $rp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.op.com/saml/metadata; lemonldap=$rpId" + cookie => "lemonldap=$rpId" ), 'Test if user is reject on SP' ); @@ -317,8 +314,7 @@ m#iframe src="http://auth.op.com(/saml/relaySingleLogoutPOST)\?(relay=.*?)"#s, $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.op.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); diff --git a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t index 16a222bdc..2347bb9e2 100644 --- a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t +++ b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t @@ -115,8 +115,6 @@ SKIP: { $url, query => $query, accept => 'text/html', - - # cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata' ), "Push request to OP, endpoint $url" ); @@ -186,7 +184,7 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => "lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "$spPdata" ), 'POST SAML response' ); @@ -200,8 +198,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Follow internal redirection from SAML-SP to OIDC-OP' ); @@ -211,8 +208,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Confirm OIDC sharing' ); diff --git a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t index 9bfe78655..c2cf01878 100644 --- a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t +++ b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-GET.t @@ -115,8 +115,6 @@ SKIP: { $url, query => $query, accept => 'text/html', - - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata' ), "Push request to OP, endpoint $url" ); @@ -169,7 +167,7 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => "lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "$spPdata" ), 'POST SAML response' ); @@ -183,8 +181,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Follow internal redirection from SAML-SP to OIDC-OP' ); @@ -194,8 +191,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Confirm OIDC sharing' ); diff --git a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t index 6f4e91653..5428e9dd8 100644 --- a/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t +++ b/lemonldap-ng-portal/t/37-OIDC-RP-to-SAML-IdP-POST.t @@ -115,8 +115,6 @@ SKIP: { $url, query => $query, accept => 'text/html', - - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata' ), "Push request to OP, endpoint $url" ); @@ -171,7 +169,7 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => "lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata", + cookie => "$spPdata", ), 'POST SAML response' ); @@ -185,8 +183,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Follow internal redirection from SAML-SP to OIDC-OP' ); @@ -196,8 +193,7 @@ SKIP: { $url, query => $query, accept => 'text/html', - cookie => -"lemonldap=$spId;lemonldapidp=http://auth.idp.com/saml/metadata;$spPdata" + cookie => "lemonldap=$spId;$spPdata" ), 'Confirm OIDC sharing' ); diff --git a/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t b/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t index f7f185aa7..eebe4ea45 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-GET-to-OIDC-OP.t @@ -107,7 +107,6 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata' ), 'Try SAML SP' ); @@ -207,7 +206,6 @@ SKIP: { $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server-with-Choice.t b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server-with-Choice.t index 23bc0e863..7f3968d32 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server-with-Choice.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server-with-Choice.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 17; +my $maintests = 16; my $debug = 'error'; my ( $issuer, $proxy, $sp, $res ); my %handlerOR = ( issuer => [], proxy => [], sp => [] ); @@ -88,11 +88,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.proxy.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $query ) = expectAutoPost( $res, 'auth.proxy.com', '/saml/singleSignOn', @@ -189,7 +184,6 @@ qr'^http://auth.idp.com/cas/login\?(service=http%3A%2F%2Fauth.proxy.com%2F.*)$' $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server.t b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server.t index cedb7427a..839856d46 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-CAS-server.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 15; +my $maintests = 14; my $debug = 'error'; my ( $issuer, $proxy, $sp, $res ); my %handlerOR = ( issuer => [], proxy => [], sp => [] ); @@ -89,11 +89,6 @@ SKIP: { ), 'Unauth SP request' ); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.proxy.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $query ) = expectAutoPost( $res, 'auth.proxy.com', '/saml/singleSignOn', @@ -174,7 +169,6 @@ qr'^http://auth.idp.com/cas/login\?(service=http%3A%2F%2Fauth.proxy.com%2F.*)$' $url, IO::String->new($query), accept => 'text/html', length => length($query), - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t index 43dce75f6..ab604ecf9 100644 --- a/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t +++ b/lemonldap-ng-portal/t/37-SAML-SP-POST-to-OIDC-OP.t @@ -107,7 +107,6 @@ SKIP: { $res = $sp->_get( '/', accept => 'text/html', - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata' ), 'Try SAML SP' ); @@ -205,7 +204,6 @@ SKIP: { $url, IO::String->new($query), length => length($query), accept => 'text/html', - cookie => 'lemonldapidp=http://auth.proxy.com/saml/metadata', ), 'Post SAML response to SP' ); diff --git a/lemonldap-ng-portal/t/67-CheckUser-with-issuer-SAML-POST.t b/lemonldap-ng-portal/t/67-CheckUser-with-issuer-SAML-POST.t index 03f1f4b8d..67cfa1cbd 100644 --- a/lemonldap-ng-portal/t/67-CheckUser-with-issuer-SAML-POST.t +++ b/lemonldap-ng-portal/t/67-CheckUser-with-issuer-SAML-POST.t @@ -11,7 +11,7 @@ BEGIN { require 't/saml-lib.pm'; } -my $maintests = 24; +my $maintests = 21; my $debug = 'error'; my ( $issuer, $sp, $res ); my %handlerOR = ( issuer => [], sp => [] ); @@ -50,11 +50,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); my ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -96,11 +91,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -147,7 +137,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -173,11 +162,6 @@ SKIP: { 'Unauth SP request' ); expectOK($res); - ok( expectCookie( $res, 'lemonldapidp' ), 'IDP cookie defined' ) - or explain( - $res->[1], -'Set-Cookie => lemonldapidp=http://auth.idp.com/saml/metadata; domain=.sp.com; path=/' - ); ( $host, $url, $s ) = expectAutoPost( $res, 'auth.idp.com', '/saml/singleSignOn', 'SAMLRequest' ); @@ -225,7 +209,6 @@ SKIP: { $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -356,7 +339,6 @@ m%
%, $url, IO::String->new($s), accept => 'text/html', length => length($s), - cookie => 'lemonldapidp=http://auth.idp.com/saml/metadata', ), 'Post SAML response to SP' ); @@ -377,8 +359,7 @@ m%
%, $res = $sp->_get( '/', accept => 'text/html', - cookie => - "lemonldapidp=http://auth.idp.com/saml/metadata; lemonldap=$spId" + cookie => "lemonldap=$spId" ), 'Test if user is reject on SP' ); From 8903874b983e1e06544bdeb59dfa183f2a689cb0 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 26 Oct 2019 12:43:27 +0200 Subject: [PATCH 02/24] WIP - Append option & update langs --- .../lib/Lemonldap/NG/Handler/Main/Reload.pm | 9 ++++++++- .../lib/Lemonldap/NG/Manager/Conf/Parser.pm | 1 + lemonldap-ng-manager/site/htdocs/static/forms/rule.html | 4 ++++ .../site/htdocs/static/forms/ruleContainer.html | 6 +++++- .../site/htdocs/static/languages/ar.json | 2 ++ .../site/htdocs/static/languages/de.json | 2 ++ .../site/htdocs/static/languages/en.json | 2 ++ .../site/htdocs/static/languages/fr.json | 2 ++ .../site/htdocs/static/languages/it.json | 2 ++ .../site/htdocs/static/languages/vi.json | 2 ++ .../site/htdocs/static/languages/zh.json | 2 ++ 11 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm index 6c84d1fd8..bad595075 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm @@ -10,6 +10,7 @@ use Lemonldap::NG::Common::Crypto; use Lemonldap::NG::Common::Safelib; #link protected safe Safe object use Lemonldap::NG::Handler::Main::Jail; use Scalar::Util qw(weaken); +use Data::Dumper; use constant UNPROTECT => 1; use constant SKIP => 2; @@ -295,6 +296,11 @@ sub locationRulesInit { push @{ $class->tsv->{locationCondition}->{$vhost} }, $cond; push @{ $class->tsv->{locationProtection}->{$vhost} }, $prot; push @{ $class->tsv->{locationRegexp}->{$vhost} }, qr/$url/; +# $class->logger->debug("**** -> " . Data::Dumper::Dumper($cond)); +# push @{ $class->tsv->{locationRequiredLevel}->{$vhost} }, +# $cond =~ /\(\(\?#(\d)\)\)$/ ? $1 +# : undef; +# $cond =~ s/\(\(\?#\d+\)\)$//; push @{ $class->tsv->{locationConditionText}->{$vhost} }, $cond =~ /^\(\?#(.*?)\)/ ? $1 : $cond =~ /^(.*?)##(.+)$/ ? $2 @@ -302,7 +308,8 @@ sub locationRulesInit { $class->tsv->{locationCount}->{$vhost}++; } } - +$class->logger->debug("**** " . Data::Dumper::Dumper($class->tsv)); + # Default policy set to 'accept' unless ( $class->tsv->{defaultCondition}->{$vhost} ) { $class->tsv->{defaultCondition}->{$vhost} = sub { 1 }; diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm index 92424341e..19e267984 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm @@ -266,6 +266,7 @@ sub _scanNodes { $leaf->{comment} ? "(?#$leaf->{comment})$leaf->{re}" : $leaf->{re}; + $k .= "((?#$leaf->{level}))" if $leaf->{level}; $self->set( $target, $key, $k, $leaf->{data} ); } else { diff --git a/lemonldap-ng-manager/site/htdocs/static/forms/rule.html b/lemonldap-ng-manager/site/htdocs/static/forms/rule.html index 002f36641..64811cfc2 100644 --- a/lemonldap-ng-manager/site/htdocs/static/forms/rule.html +++ b/lemonldap-ng-manager/site/htdocs/static/forms/rule.html @@ -17,6 +17,10 @@