diff --git a/src/main/resources/saml-extended-frontend/js/AddProvider.js b/src/main/resources/saml-extended-frontend/js/AddProvider.js index 99bbc23..2418292 100644 --- a/src/main/resources/saml-extended-frontend/js/AddProvider.js +++ b/src/main/resources/saml-extended-frontend/js/AddProvider.js @@ -246,7 +246,10 @@ add.addEventListener('click', () => { "sendClientIdOnLogout": client_id_in_logout_requests.value, "enabledFromMetadata": useEntityDescriptor.value, "metadataDescriptorUrl": samlEntityDescriptor_input.value, - "attributeConsumingServiceMetadata":attributeServicesArray.length > 0 ? JSON.stringify(attributeServicesArray) : undefined + "attributeConsumingServiceMetadata":attributeServicesArray.length > 0 ? JSON.stringify(attributeServicesArray) : undefined, + "customErrorRedirectEnabled": customErrorRedirectEnabled.value, + "errorCallback": errorCallback_input.value, + "cancelledCallback": cancelledCallback_input.value }} diff --git a/src/main/resources/saml-extended-frontend/js/CheckBoxControllerAddProvider.js b/src/main/resources/saml-extended-frontend/js/CheckBoxControllerAddProvider.js index f810702..11b59a0 100644 --- a/src/main/resources/saml-extended-frontend/js/CheckBoxControllerAddProvider.js +++ b/src/main/resources/saml-extended-frontend/js/CheckBoxControllerAddProvider.js @@ -1,243 +1,233 @@ - -document.addEventListener('DOMContentLoaded', function() { - const formElements = document.getElementById('GeneralSetting').elements; - samlEntityDescriptor.addEventListener('input', function() { - if (samlEntityDescriptor.value.trim() !== '') { - import_data.style.display = 'block'; - } else { - import_data.style.display = 'none'; - } - }); - - document.getElementById('showMetadataLink').addEventListener('click', function(event) { - event.preventDefault(); - var data = document.getElementById('data'); - if (data.style.display === 'none'|| data.style.display === '') { - data.style.display = 'block'; - this.textContent = 'Hide Metadata'; - } else { - data.style.display = 'none'; - this.textContent = 'Show Metadata'; - } - }); - const useEntityDescriptor = document.getElementById("useEntityDescriptor"); - const entityDes=document.getElementById("entityDes") - const showMetadataLink=document.getElementById("showMetadataLink") - useEntityDescriptor.addEventListener("change", function () { - var data = document.getElementById('data'); - if (useEntityDescriptor.checked) { - useEntityDescriptor.value = "true"; - data.style.display = 'none'; - entityDes.style.display='block' - showMetadataLink.style.display='block' - for (var i = 0; i < formElements.length; i++) { - formElements[i].readOnly = true; - formElements[i].disabled = true; // for select elements - } - - } else { - for (var i = 0; i < formElements.length; i++) { - formElements[i].readOnly = false; - formElements[i].disabled = false; // for select elements - } - useEntityDescriptor.value = "false"; - data.style.display = 'block'; - entityDes.style.display='none' - showMetadataLink.style.display='none' - } - }); - - const backchannel = document.getElementById("backchannel"); - storedData = localStorage.getItem('pluginData'); - var pluginData = JSON.parse(storedData); - - - const enabled = document.getElementById("enabled"); - enabled.addEventListener("change", function () { - handleCheckboxValue(enabled); - - }); - - const ArtifactResolutionService_in_metadata = document.getElementById("ArtifactResolutionService_in_metadata"); - ArtifactResolutionService_in_metadata.addEventListener("change", function () { - handleCheckboxValue(ArtifactResolutionService_in_metadata); - }); - - backchannel.addEventListener("change", function () { - handleCheckboxValue(backchannel); - }); - - - const allowCreate = document.getElementById("allowCreate"); - allowCreate.addEventListener("change", function () { - handleCheckboxValue(allowCreate); - - }); - - - - - const httpPostBindingResponse = document.getElementById("httpPostBindingResponse"); - httpPostBindingResponse.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingResponse); - }); - - const artifactBindingResponse = document.getElementById("artifactBindingResponse"); - artifactBindingResponse.addEventListener("change", function () { - handleCheckboxValue(artifactBindingResponse); - }); - - const httpPostBindingAuthnRequest = document.getElementById("httpPostBindingAuthnRequest"); - httpPostBindingAuthnRequest.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingAuthnRequest); - - }); - - const httpPostBindingLogout = document.getElementById("httpPostBindingLogout"); - httpPostBindingLogout.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingLogout); - - }); - - - const wantAssertionsSigned = document.getElementById("wantAssertionsSigned"); - wantAssertionsSigned.addEventListener("change", function () { - handleCheckboxValue(wantAssertionsSigned); - - }); - - - const wantAssertionsEncrypted = document.getElementById("wantAssertionsEncrypted"); - wantAssertionsEncrypted.addEventListener("change", function () { - handleCheckboxValue(wantAssertionsEncrypted); - - }); - - - const forceAuthentication = document.getElementById("forceAuthentication"); - forceAuthentication.addEventListener("change", function () { - handleCheckboxValue(forceAuthentication); - - }); - - - - const signMetadata = document.getElementById("signMetadata"); - signMetadata.addEventListener("change", function () { - handleCheckboxValue(signMetadata); - - }); - - - const passSubject = document.getElementById("passSubject"); - passSubject.addEventListener("change", function () { - handleCheckboxValue(passSubject); - - }); - - - const storeToken = document.getElementById("storeToken"); - storeToken.addEventListener("change", function () { - handleCheckboxValue(storeToken); - - }); - const id_token_hint=document.getElementById("id_token_hint"); - id_token_hint.addEventListener("change", function () { - handleCheckboxValue(id_token_hint); - - }); - const client_id_in_logout_requests=document.getElementById("client_id_in_logout_requests") - client_id_in_logout_requests.addEventListener("change", function () { - handleCheckboxValue(client_id_in_logout_requests); - - }); - - const storedTokensReadable = document.getElementById("storedTokensReadable"); - storedTokensReadable.addEventListener("change", function () { - handleCheckboxValue(storedTokensReadable); - - }); - - - const trustEmail = document.getElementById("trustEmail"); - trustEmail.addEventListener("change", function () { - handleCheckboxValue(trustEmail); - - }); - - - - - const accountLinkingOnly = document.getElementById("accountLinkingOnly"); - accountLinkingOnly.addEventListener("change", function () { - handleCheckboxValue(accountLinkingOnly); - - }); - - - const hideLoginPage = document.getElementById("hideLoginPage"); - hideLoginPage.addEventListener("change", function () { - handleCheckboxValue(hideLoginPage); - - }); - - - var SignatureAlgorithm = document.getElementById("SignatureAlgorithm"); - var SAMLSignatureKeyName = document.getElementById("SAMLSignatureKeyName"); - - const wantAuthnRequestsSigned = document.getElementById("wantAuthnRequestsSigned"); - wantAuthnRequestsSigned.addEventListener("change", function () { - if (wantAuthnRequestsSigned.checked) { - wantAuthnRequestsSigned.value = true; - SignatureAlgorithm.removeAttribute("disabled"); - SAMLSignatureKeyName.removeAttribute("disabled"); - encryption_algorithm.removeAttribute("disabled"); - - } - else { - wantAuthnRequestsSigned.value = false; - SignatureAlgorithm.setAttribute("disabled", "true"); - SAMLSignatureKeyName.setAttribute("disabled", "true"); - encryption_algorithm.setAttribute("disabled", "true"); - - - ; - } - }); - - - const deleteButtonsClassRefs = document.querySelectorAll(".delete"); - const addButtonClassRefs = document.getElementById("addClassRefs"); - const ClassRefs_items = document.getElementById("ClassRefs_items"); - +document.addEventListener('DOMContentLoaded', function () { + const formElements = document.getElementById('GeneralSetting').elements; + samlEntityDescriptor.addEventListener('input', function () { + if (samlEntityDescriptor.value.trim() !== '') { + import_data.style.display = 'block'; + } else { + import_data.style.display = 'none'; + } + }); + + document.getElementById('showMetadataLink').addEventListener('click', function (event) { + event.preventDefault(); + var data = document.getElementById('data'); + if (data.style.display === 'none' || data.style.display === '') { + data.style.display = 'block'; + this.textContent = 'Hide Metadata'; + } else { + data.style.display = 'none'; + this.textContent = 'Show Metadata'; + } + }); + const useEntityDescriptor = document.getElementById("useEntityDescriptor"); + const entityDes = document.getElementById("entityDes") + const showMetadataLink = document.getElementById("showMetadataLink") + useEntityDescriptor.addEventListener("change", function () { + var data = document.getElementById('data'); + if (useEntityDescriptor.checked) { + useEntityDescriptor.value = "true"; + data.style.display = 'none'; + entityDes.style.display = 'block' + showMetadataLink.style.display = 'block' + for (var i = 0; i < formElements.length; i++) { + formElements[i].readOnly = true; + formElements[i].disabled = true; // for select elements + } + + } else { + for (var i = 0; i < formElements.length; i++) { + formElements[i].readOnly = false; + formElements[i].disabled = false; // for select elements + } + useEntityDescriptor.value = "false"; + data.style.display = 'block'; + entityDes.style.display = 'none' + showMetadataLink.style.display = 'none' + } + }); + + const backchannel = document.getElementById("backchannel"); + storedData = localStorage.getItem('pluginData'); + var pluginData = JSON.parse(storedData); + + + const enabled = document.getElementById("enabled"); + enabled.addEventListener("change", function () { + handleCheckboxValue(enabled); + + }); + + const ArtifactResolutionService_in_metadata = document.getElementById("ArtifactResolutionService_in_metadata"); + ArtifactResolutionService_in_metadata.addEventListener("change", function () { + handleCheckboxValue(ArtifactResolutionService_in_metadata); + }); + + backchannel.addEventListener("change", function () { + handleCheckboxValue(backchannel); + }); + + + const allowCreate = document.getElementById("allowCreate"); + allowCreate.addEventListener("change", function () { + handleCheckboxValue(allowCreate); + + }); + + + const httpPostBindingResponse = document.getElementById("httpPostBindingResponse"); + httpPostBindingResponse.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingResponse); + }); + + + const httpPostBindingAuthnRequest = document.getElementById("httpPostBindingAuthnRequest"); + httpPostBindingAuthnRequest.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingAuthnRequest); + + }); + + const httpPostBindingLogout = document.getElementById("httpPostBindingLogout"); + httpPostBindingLogout.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingLogout); + + }); + + + const wantAssertionsSigned = document.getElementById("wantAssertionsSigned"); + wantAssertionsSigned.addEventListener("change", function () { + handleCheckboxValue(wantAssertionsSigned); + + }); + + + const wantAssertionsEncrypted = document.getElementById("wantAssertionsEncrypted"); + wantAssertionsEncrypted.addEventListener("change", function () { + handleCheckboxValue(wantAssertionsEncrypted); + + }); + + + const forceAuthentication = document.getElementById("forceAuthentication"); + forceAuthentication.addEventListener("change", function () { + handleCheckboxValue(forceAuthentication); + + }); + + + const signMetadata = document.getElementById("signMetadata"); + signMetadata.addEventListener("change", function () { + handleCheckboxValue(signMetadata); + + }); + + + const passSubject = document.getElementById("passSubject"); + passSubject.addEventListener("change", function () { + handleCheckboxValue(passSubject); + + }); + + + const storeToken = document.getElementById("storeToken"); + storeToken.addEventListener("change", function () { + handleCheckboxValue(storeToken); + + }); + const id_token_hint = document.getElementById("id_token_hint"); + id_token_hint.addEventListener("change", function () { + handleCheckboxValue(id_token_hint); + + }); + const client_id_in_logout_requests = document.getElementById("client_id_in_logout_requests") + client_id_in_logout_requests.addEventListener("change", function () { + handleCheckboxValue(client_id_in_logout_requests); + + }); + + const storedTokensReadable = document.getElementById("storedTokensReadable"); + storedTokensReadable.addEventListener("change", function () { + handleCheckboxValue(storedTokensReadable); + + }); + + + const trustEmail = document.getElementById("trustEmail"); + trustEmail.addEventListener("change", function () { + handleCheckboxValue(trustEmail); + + }); + + + const accountLinkingOnly = document.getElementById("accountLinkingOnly"); + accountLinkingOnly.addEventListener("change", function () { + handleCheckboxValue(accountLinkingOnly); + + }); + + + const hideLoginPage = document.getElementById("hideLoginPage"); + hideLoginPage.addEventListener("change", function () { + handleCheckboxValue(hideLoginPage); + + }); + + + var SignatureAlgorithm = document.getElementById("SignatureAlgorithm"); + var SAMLSignatureKeyName = document.getElementById("SAMLSignatureKeyName"); + + const wantAuthnRequestsSigned = document.getElementById("wantAuthnRequestsSigned"); + wantAuthnRequestsSigned.addEventListener("change", function () { + if (wantAuthnRequestsSigned.checked) { + wantAuthnRequestsSigned.value = true; + SignatureAlgorithm.removeAttribute("disabled"); + SAMLSignatureKeyName.removeAttribute("disabled"); + encryption_algorithm.removeAttribute("disabled"); + + } else { + wantAuthnRequestsSigned.value = false; + SignatureAlgorithm.setAttribute("disabled", "true"); + SAMLSignatureKeyName.setAttribute("disabled", "true"); + encryption_algorithm.setAttribute("disabled", "true"); + + + ; + } + }); + + + const deleteButtonsClassRefs = document.querySelectorAll(".delete"); + const addButtonClassRefs = document.getElementById("addClassRefs"); + const ClassRefs_items = document.getElementById("ClassRefs_items"); + + deleteButtonsClassRefs.forEach(function (button) { + button.style.display = "inline"; + }); + + addButtonClassRefs.addEventListener("click", function (e) { deleteButtonsClassRefs.forEach(function (button) { - button.style.display = "inline";}); + button.style.display = "inline"; + }); - addButtonClassRefs.addEventListener("click", function (e) { - deleteButtonsClassRefs.forEach(function (button) { + const newItem = document.createElement("div"); + newItem.className = "next-referral col-4"; + newItem.innerHTML = ''; + ClassRefs_items.appendChild(newItem); + }); + + document.body.addEventListener("click", function (e) { + if (e.target.classList.contains("delete")) { + e.preventDefault(); + const items = ClassRefs_items.querySelectorAll(".next-referral"); + if (items.length > 0) { + items[items.length - 1].remove(); + deleteButtonsClassRefs.forEach(function (button, index) { + if (index === items.length - 1) { button.style.display = "inline"; + } }); - - const newItem = document.createElement("div"); - newItem.className = "next-referral col-4"; - newItem.innerHTML = ''; - ClassRefs_items.appendChild(newItem); - }); - - document.body.addEventListener("click", function (e) { - if (e.target.classList.contains("delete")) { - e.preventDefault(); - const items = ClassRefs_items.querySelectorAll(".next-referral"); - if (items.length > 0) { - items[items.length - 1].remove(); - deleteButtonsClassRefs.forEach(function (button, index) { - if (index === items.length - 1) { - button.style.display = "inline"; - } - }); - } - } - }); + } + } + }); }); const deleteButtonsDeclRefs = document.querySelectorAll(".delete1"); @@ -245,34 +235,34 @@ const addButtonDeclRefs = document.getElementById("addDeclRefs"); const DeclRefs_items = document.getElementById("DeclRefs_items"); deleteButtonsDeclRefs.forEach(function (button) { - button.style.display = "inline"; + button.style.display = "inline"; }); addButtonDeclRefs.addEventListener("click", function (e) { - deleteButtonsDeclRefs.forEach(function (button) { - button.style.display = "inline"; - }); - - const newItem = document.createElement("div"); - newItem.className = "next-referral col-4"; - newItem.innerHTML = ''; - DeclRefs_items.appendChild(newItem); + deleteButtonsDeclRefs.forEach(function (button) { + button.style.display = "inline"; + }); + + const newItem = document.createElement("div"); + newItem.className = "next-referral col-4"; + newItem.innerHTML = ''; + DeclRefs_items.appendChild(newItem); }); document.body.addEventListener("click", function (e) { - if (e.target.classList.contains("delete1")) { - e.preventDefault(); - const items = DeclRefs_items.querySelectorAll(".next-referral"); - if (items.length > 0) { - items[items.length - 1].remove(); - deleteButtonsDeclRefs.forEach(function (button, index) { - if (index === items.length - 1) { - button.style.display = "inline"; - } - }); + if (e.target.classList.contains("delete1")) { + e.preventDefault(); + const items = DeclRefs_items.querySelectorAll(".next-referral"); + if (items.length > 0) { + items[items.length - 1].remove(); + deleteButtonsDeclRefs.forEach(function (button, index) { + if (index === items.length - 1) { + button.style.display = "inline"; } + }); } - + } + }); @@ -281,72 +271,76 @@ var additionalField1 = document.getElementById("ValidatingX509Certificates"); validateSignatures.addEventListener("change", function () { - if (validateSignatures.checked) { - validateSignatures.value = true; - additionalField1.removeAttribute("disabled"); - - - } - else { - validateSignatures.value = false; - additionalField1.setAttribute("disabled", "true"); - additionalField1.value = ''; - } + if (validateSignatures.checked) { + validateSignatures.value = true; + additionalField1.removeAttribute("disabled"); + + + } else { + validateSignatures.value = false; + additionalField1.setAttribute("disabled", "true"); + additionalField1.value = ''; + } }); var Artifact_Resolution = document.getElementById("Artifact_Resolution"); Artifact_Resolution.addEventListener("change", function () { - if (Artifact_Resolution.checked) { - Artifact_Resolution.value = true; - additionalField_endpoint.removeAttribute("disabled"); - - } - else { - Artifact_Resolution.value = false; - additionalField_endpoint.setAttribute("disabled", "true"); - additionalField_endpoint.value = ''; - ; - } + if (Artifact_Resolution.checked) { + Artifact_Resolution.value = true; + additionalField_endpoint.removeAttribute("disabled"); + + } else { + Artifact_Resolution.value = false; + additionalField_endpoint.setAttribute("disabled", "true"); + additionalField_endpoint.value = ''; + ; + } } ); const Sign_Artifact_Resolution_Request = document.getElementById("Sign_Artifact_Resolution_Request"); Sign_Artifact_Resolution_Request.addEventListener("change", function () { - handleCheckboxValue(Sign_Artifact_Resolution_Request); - + handleCheckboxValue(Sign_Artifact_Resolution_Request); + +}); + +const ArtifactResolution_via_HTTP_ARTIFACT = document.getElementById("ArtifactResolution_via_HTTP_ARTIFACT"); +ArtifactResolution_via_HTTP_ARTIFACT.addEventListener("change", function () { + handleCheckboxValue(ArtifactResolution_via_HTTP_ARTIFACT); + }); + const Artifact_Resolution_with_SOAP = document.getElementById("Artifact_Resolution_with_SOAP"); Artifact_Resolution_with_SOAP.addEventListener("change", function () { - handleCheckboxValue(Artifact_Resolution_with_SOAP); - + handleCheckboxValue(Artifact_Resolution_with_SOAP); + }); - const Artifact_Resolution_with_XML_header = document.getElementById("Artifact_Resolution_with_XML_header"); Artifact_Resolution_with_XML_header.addEventListener("change", function () { - handleCheckboxValue(Artifact_Resolution_with_XML_header); - + handleCheckboxValue(Artifact_Resolution_with_XML_header); + }); const Mutual_TLS = document.getElementById("Mutual_TLS"); Mutual_TLS.addEventListener("change", function () { - handleCheckboxValue(Mutual_TLS); + handleCheckboxValue(Mutual_TLS); }); principalType_input.addEventListener('change', function () { - if (principalType_input.value == "ATTRIBUTE" || principalType_input.value == "FRIENDLY_ATTRIBUTE") { - principalAttribute_input.removeAttribute("disabled"); - - } else { - principalAttribute_input.value = ''; - principalAttribute_input.setAttribute("disabled", "true"); - - } + if (principalType_input.value == "ATTRIBUTE" || principalType_input.value == "FRIENDLY_ATTRIBUTE") { + principalAttribute_input.removeAttribute("disabled"); + + } else { + principalAttribute_input.value = ''; + principalAttribute_input.setAttribute("disabled", "true"); + } + }); diff --git a/src/main/resources/saml-extended-frontend/js/CheckBoxControllerEditProvider.js b/src/main/resources/saml-extended-frontend/js/CheckBoxControllerEditProvider.js index 26822ce..7215d45 100644 --- a/src/main/resources/saml-extended-frontend/js/CheckBoxControllerEditProvider.js +++ b/src/main/resources/saml-extended-frontend/js/CheckBoxControllerEditProvider.js @@ -1,356 +1,363 @@ - - -document.addEventListener('DOMContentLoaded', function() { - storedData = localStorage.getItem('pluginData'); - var pluginData = JSON.parse(storedData); - backchannel.value = pluginData.config.backchannelSupported ? pluginData.config.backchannelSupported : false; - backchannel.addEventListener("change", function () { - handleCheckboxValue(backchannel); +document.addEventListener('DOMContentLoaded', function () { + storedData = localStorage.getItem('pluginData'); + var pluginData = JSON.parse(storedData); + backchannel.value = pluginData.config.backchannelSupported ? pluginData.config.backchannelSupported : false; + backchannel.addEventListener("change", function () { + handleCheckboxValue(backchannel); + }); + + + const allowCreate = document.getElementById("allowCreate"); + allowCreate.value = pluginData.config.allowCreate ? pluginData.config.allowCreate : false; + allowCreate.addEventListener("change", function () { + handleCheckboxValue(allowCreate); + }); + + + const httpPostBindingResponse = document.getElementById("httpPostBindingResponse"); + httpPostBindingResponse.value = pluginData.config.postBindingResponse ? pluginData.config.postBindingResponse : false; + httpPostBindingResponse.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingResponse); + + + }); + + + const httpPostBindingAuthnRequest = document.getElementById("httpPostBindingAuthnRequest"); + httpPostBindingAuthnRequest.value = pluginData.config.postBindingAuthnRequest ? pluginData.config.postBindingAuthnRequest : false; + httpPostBindingAuthnRequest.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingAuthnRequest); + + }); + + const httpPostBindingLogout = document.getElementById("httpPostBindingLogout"); + httpPostBindingLogout.value = pluginData.config.postBindingLogout ? pluginData.config.postBindingLogout : false; + httpPostBindingLogout.addEventListener("change", function () { + handleCheckboxValue(httpPostBindingLogout); + + }); + + + const wantAssertionsSigned = document.getElementById("wantAssertionsSigned"); + wantAssertionsSigned.value = pluginData.config.wantAssertionsSigned ? pluginData.config.wantAssertionsSigned : false; + wantAssertionsSigned.addEventListener("change", function () { + handleCheckboxValue(wantAssertionsSigned); + + }); + + + const wantAssertionsEncrypted = document.getElementById("wantAssertionsEncrypted"); + wantAssertionsEncrypted.value = pluginData.config.wantAssertionsEncrypted ? pluginData.config.wantAssertionsEncrypted : false; + wantAssertionsEncrypted.addEventListener("change", function () { + handleCheckboxValue(wantAssertionsEncrypted); + + }); + + + const forceAuthentication = document.getElementById("forceAuthentication"); + forceAuthentication.value = pluginData.config.forceAuthn ? pluginData.config.forceAuthn : false; + forceAuthentication.addEventListener("change", function () { + handleCheckboxValue(forceAuthentication); + }); + + + const signMetadata = document.getElementById("signMetadata"); + signMetadata.value = pluginData.config.signSpMetadata ? pluginData.config.signSpMetadata : false + signMetadata.addEventListener("change", function () { + handleCheckboxValue(signMetadata); + + }); + + + const passSubject = document.getElementById("passSubject"); + passSubject.value = pluginData.config.loginHint ? pluginData.config.loginHint : false; + passSubject.addEventListener("change", function () { + handleCheckboxValue(passSubject); + + }); + + + const storeToken = document.getElementById("storeToken"); + storeToken.value = pluginData.storeToken ? pluginData.storeToken : false; + storeToken.addEventListener("change", function () { + handleCheckboxValue(storeToken); + + }); + + + const storedTokensReadable = document.getElementById("storedTokensReadable"); + storedTokensReadable.value = pluginData.addReadTokenRoleOnCreate ? pluginData.addReadTokenRoleOnCreate : false; + storedTokensReadable.addEventListener("change", function () { + handleCheckboxValue(storedTokensReadable); + + }); + + const id_token_hint = document.getElementById("id_token_hint"); + id_token_hint.value = pluginData.config.sendIdTokenOnLogout ? pluginData.config.sendIdTokenOnLogout : false; + id_token_hint.addEventListener("change", function () { + handleCheckboxValue(id_token_hint); + }); + + const client_id_in_logout_requests = document.getElementById("client_id_in_logout_requests") + client_id_in_logout_requests.value = pluginData.config.sendClientIdOnLogout ? pluginData.config.sendClientIdOnLogout : false; + client_id_in_logout_requests.addEventListener("change", function () { + handleCheckboxValue(client_id_in_logout_requests); + + }); + + const trustEmail = document.getElementById("trustEmail"); + trustEmail.value = pluginData.trustEmail ? pluginData.trustEmail : false; + trustEmail.addEventListener("change", function () { + handleCheckboxValue(trustEmail); + + }); + + + const accountLinkingOnly = document.getElementById("accountLinkingOnly"); + accountLinkingOnly.value = pluginData.linkOnly ? pluginData.linkOnly : false; + accountLinkingOnly.addEventListener("change", function () { + handleCheckboxValue(accountLinkingOnly); + + }); + + + const hideLoginPage = document.getElementById("hideLoginPage"); + hideLoginPage.value = pluginData.config.hideOnLoginPage ? pluginData.config.hideOnLoginPage : false; + hideLoginPage.addEventListener("change", function () { + handleCheckboxValue(hideLoginPage); + + }); + + + var SignatureAlgorithm = document.getElementById("SignatureAlgorithm"); + var SAMLSignatureKeyName = document.getElementById("SAMLSignatureKeyName"); + + const wantAuthnRequestsSigned = document.getElementById("wantAuthnRequestsSigned"); + wantAuthnRequestsSigned.value = pluginData.config.wantAuthnRequestsSigned ? pluginData.config.wantAuthnRequestsSigned : false; + wantAuthnRequestsSigned.addEventListener("change", function () { + if (wantAuthnRequestsSigned.checked) { + wantAuthnRequestsSigned.value = true; + SignatureAlgorithm.removeAttribute("disabled"); + SAMLSignatureKeyName.removeAttribute("disabled"); + encryption_algorithm.removeAttribute("disabled"); + + } else { + wantAuthnRequestsSigned.value = false; + SignatureAlgorithm.setAttribute("disabled", "true"); + SAMLSignatureKeyName.setAttribute("disabled", "true"); + encryption_algorithm.setAttribute("disabled", "true"); + + + ; + } + }); + + const ArtifactResolutionService_in_metadata = document.getElementById("ArtifactResolutionService_in_metadata"); + ArtifactResolutionService_in_metadata.value = pluginData.config.includeArtifactResolutionServiceMetadata ? pluginData.config.includeArtifactResolutionServiceMetadata : false; + ArtifactResolutionService_in_metadata.addEventListener("change", function () { + handleCheckboxValue(ArtifactResolutionService_in_metadata); + + }); + + document.addEventListener("DOMContentLoaded", function () { + const deleteButtonsClassRefs = document.querySelectorAll(".delete"); + const addButtonClassRefs = document.getElementById("addClassRefs"); + const ClassRefs_items = document.getElementById("ClassRefs_items"); + + deleteButtonsClassRefs.forEach(function (button) { + button.style.display = "inline"; }); - - const allowCreate = document.getElementById("allowCreate"); - allowCreate.value = pluginData.config.allowCreate ? pluginData.config.allowCreate : false; - allowCreate.addEventListener("change", function () { - handleCheckboxValue(allowCreate); - }); - - const httpPostBindingResponse = document.getElementById("httpPostBindingResponse"); - httpPostBindingResponse.value = pluginData.config.postBindingResponse ? pluginData.config.postBindingResponse : false; - httpPostBindingResponse.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingResponse); - }); - - const artifactBindingResponse = document.getElementById("artifactBindingResponse"); - artifactBindingResponse.checked = pluginData.config.artifactBindingResponse === 'true'; - artifactBindingResponse.value = artifactBindingResponse.checked; - artifactBindingResponse.addEventListener("change", function () { - handleCheckboxValue(artifactBindingResponse); - }); - - const httpPostBindingAuthnRequest = document.getElementById("httpPostBindingAuthnRequest"); - httpPostBindingAuthnRequest.value = pluginData.config.postBindingAuthnRequest ? pluginData.config.postBindingAuthnRequest : false; - httpPostBindingAuthnRequest.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingAuthnRequest); - - }); - - const httpPostBindingLogout = document.getElementById("httpPostBindingLogout"); - httpPostBindingLogout.value = pluginData.config.postBindingLogout ? pluginData.config.postBindingLogout : false; - httpPostBindingLogout.addEventListener("change", function () { - handleCheckboxValue(httpPostBindingLogout); - - }); - - - const wantAssertionsSigned = document.getElementById("wantAssertionsSigned"); - wantAssertionsSigned.value = pluginData.config.wantAssertionsSigned ? pluginData.config.wantAssertionsSigned : false; - wantAssertionsSigned.addEventListener("change", function () { - handleCheckboxValue(wantAssertionsSigned); - - }); - - - const wantAssertionsEncrypted = document.getElementById("wantAssertionsEncrypted"); - wantAssertionsEncrypted.value = pluginData.config.wantAssertionsEncrypted ? pluginData.config.wantAssertionsEncrypted : false; - wantAssertionsEncrypted.addEventListener("change", function () { - handleCheckboxValue(wantAssertionsEncrypted); - - }); - - - const forceAuthentication = document.getElementById("forceAuthentication"); - forceAuthentication.value = pluginData.config.forceAuthn ? pluginData.config.forceAuthn : false; - forceAuthentication.addEventListener("change", function () { - handleCheckboxValue(forceAuthentication); - }); - - - - const signMetadata = document.getElementById("signMetadata"); - signMetadata.value = pluginData.config.signSpMetadata ? pluginData.config.signSpMetadata : false - signMetadata.addEventListener("change", function () { - handleCheckboxValue(signMetadata); - - }); - - - const passSubject = document.getElementById("passSubject"); - passSubject.value = pluginData.config.loginHint ? pluginData.config.loginHint : false; - passSubject.addEventListener("change", function () { - handleCheckboxValue(passSubject); - - }); - - - const storeToken = document.getElementById("storeToken"); - storeToken.value = pluginData.storeToken ? pluginData.storeToken : false; - storeToken.addEventListener("change", function () { - handleCheckboxValue(storeToken); - - }); - - - const storedTokensReadable = document.getElementById("storedTokensReadable"); - storedTokensReadable.value = pluginData.addReadTokenRoleOnCreate ? pluginData.addReadTokenRoleOnCreate : false; - storedTokensReadable.addEventListener("change", function () { - handleCheckboxValue(storedTokensReadable); - - }); - - const id_token_hint=document.getElementById("id_token_hint"); - id_token_hint.value = pluginData.config.sendIdTokenOnLogout ? pluginData.config.sendIdTokenOnLogout : false; - id_token_hint.addEventListener("change", function () { - handleCheckboxValue(id_token_hint); - }); - - const client_id_in_logout_requests=document.getElementById("client_id_in_logout_requests") - client_id_in_logout_requests.value = pluginData.config.sendClientIdOnLogout ? pluginData.config.sendClientIdOnLogout : false; - client_id_in_logout_requests.addEventListener("change", function () { - handleCheckboxValue(client_id_in_logout_requests); - - }); - - const trustEmail = document.getElementById("trustEmail"); - trustEmail.value = pluginData.trustEmail ? pluginData.trustEmail : false; - trustEmail.addEventListener("change", function () { - handleCheckboxValue(trustEmail); - - }); - - - - - const accountLinkingOnly = document.getElementById("accountLinkingOnly"); - accountLinkingOnly.value = pluginData.linkOnly ? pluginData.linkOnly : false; - accountLinkingOnly.addEventListener("change", function () { - handleCheckboxValue(accountLinkingOnly); - + addButtonClassRefs.addEventListener("click", function (e) { + deleteButtonsClassRefs.forEach(function (button) { + button.style.display = "inline"; + }); + + const newItem = document.createElement("div"); + newItem.className = "next-referral col-4"; + newItem.innerHTML = ''; + ClassRefs_items.appendChild(newItem); }); - - const hideLoginPage = document.getElementById("hideLoginPage"); - hideLoginPage.value = pluginData.hideOnLogin ? pluginData.hideOnLogin : false; - hideLoginPage.addEventListener("change", function () { - handleCheckboxValue(hideLoginPage); - - }); - - - var SignatureAlgorithm = document.getElementById("SignatureAlgorithm"); - var SAMLSignatureKeyName = document.getElementById("SAMLSignatureKeyName"); - - const wantAuthnRequestsSigned = document.getElementById("wantAuthnRequestsSigned"); - wantAuthnRequestsSigned.value = pluginData.config.wantAuthnRequestsSigned ? pluginData.config.wantAuthnRequestsSigned : false; - wantAuthnRequestsSigned.addEventListener("change", function () { - if (wantAuthnRequestsSigned.checked) { - wantAuthnRequestsSigned.value = true; - SignatureAlgorithm.removeAttribute("disabled"); - SAMLSignatureKeyName.removeAttribute("disabled"); - encryption_algorithm.removeAttribute("disabled"); - - } - else { - wantAuthnRequestsSigned.value = false; - SignatureAlgorithm.setAttribute("disabled", "true"); - SAMLSignatureKeyName.setAttribute("disabled", "true"); - encryption_algorithm.setAttribute("disabled", "true"); - - - ; + document.body.addEventListener("click", function (e) { + if (e.target.classList.contains("delete")) { + const items = ClassRefs_items.querySelectorAll(".next-referral"); + if (items.length > 0) { + items[items.length - 1].remove(); + deleteButtonsClassRefs.forEach(function (button, index) { + if (index === items.length - 1) { + button.style.display = "inline"; + } + }); } + } }); - - const ArtifactResolutionService_in_metadata = document.getElementById("ArtifactResolutionService_in_metadata"); - ArtifactResolutionService_in_metadata.value = pluginData.config.includeArtifactResolutionServiceMetadata ? pluginData.config.includeArtifactResolutionServiceMetadata : false; - ArtifactResolutionService_in_metadata.addEventListener("change", function () { - handleCheckboxValue(ArtifactResolutionService_in_metadata); - + }); + + document.addEventListener("DOMContentLoaded", function () { + const deleteButtonsDeclRefs = document.querySelectorAll(".delete1"); + const addButtonDeclRefs = document.getElementById("addDeclRefs"); + const DeclRefs_items = document.getElementById("DeclRefs_items"); + + deleteButtonsDeclRefs.forEach(function (button) { + button.style.display = "inline"; }); - document.addEventListener("DOMContentLoaded", function () { - const deleteButtonsClassRefs = document.querySelectorAll(".delete"); - const addButtonClassRefs = document.getElementById("addClassRefs"); - const ClassRefs_items = document.getElementById("ClassRefs_items"); - - deleteButtonsClassRefs.forEach(function (button) { - button.style.display = "inline"; - }); - - addButtonClassRefs.addEventListener("click", function (e) { - deleteButtonsClassRefs.forEach(function (button) { - button.style.display = "inline"; - }); - - const newItem = document.createElement("div"); - newItem.className = "next-referral col-4"; - newItem.innerHTML = ''; - ClassRefs_items.appendChild(newItem); - }); - - document.body.addEventListener("click", function (e) { - if (e.target.classList.contains("delete")) { - const items = ClassRefs_items.querySelectorAll(".next-referral"); - if (items.length > 0) { - items[items.length - 1].remove(); - deleteButtonsClassRefs.forEach(function (button, index) { - if (index === items.length - 1) { - button.style.display = "inline"; - } - }); - } - } - }); + addButtonDeclRefs.addEventListener("click", function (e) { + deleteButtonsDeclRefs.forEach(function (button) { + button.style.display = "inline"; + }); + + const newItem = document.createElement("div"); + newItem.className = "next-referral col-4"; + newItem.innerHTML = ''; + DeclRefs_items.appendChild(newItem); }); - document.addEventListener("DOMContentLoaded", function () { - const deleteButtonsDeclRefs = document.querySelectorAll(".delete1"); - const addButtonDeclRefs = document.getElementById("addDeclRefs"); - const DeclRefs_items = document.getElementById("DeclRefs_items"); - - deleteButtonsDeclRefs.forEach(function (button) { - button.style.display = "inline"; - }); - - addButtonDeclRefs.addEventListener("click", function (e) { - deleteButtonsDeclRefs.forEach(function (button) { - button.style.display = "inline"; - }); - - const newItem = document.createElement("div"); - newItem.className = "next-referral col-4"; - newItem.innerHTML = ''; - DeclRefs_items.appendChild(newItem); - }); - - document.body.addEventListener("click", function (e) { - if (e.target.classList.contains("delete1")) { - const items = DeclRefs_items.querySelectorAll(".next-referral"); - if (items.length > 0) { - items[items.length - 1].remove(); - deleteButtonsDeclRefs.forEach(function (button, index) { - if (index === items.length - 1) { - button.style.display = "inline"; - } - }); - } + document.body.addEventListener("click", function (e) { + if (e.target.classList.contains("delete1")) { + const items = DeclRefs_items.querySelectorAll(".next-referral"); + if (items.length > 0) { + items[items.length - 1].remove(); + deleteButtonsDeclRefs.forEach(function (button, index) { + if (index === items.length - 1) { + button.style.display = "inline"; } - }); - }); - - - - var validateSignatures = document.getElementById("validateSignatures"); - var additionalField1 = document.getElementById("ValidatingX509Certificates"); - var saml_EntityDescriptor=document.getElementById("saml_EntityDescriptor") - var Use_Metadata_Descriptor_URL=document.getElementById("Use_Metadata_Descriptor_URL") - validateSignatures.value = pluginData.config.validateSignature ? pluginData.config.validateSignature : false; - var validateSignatures = document.getElementById("validateSignatures"); - var additionalField1 = document.getElementById("ValidatingX509Certificates"); - var saml_EntityDescriptor = document.getElementById("saml_EntityDescriptor"); - var Use_Metadata_Descriptor_URL = document.getElementById("Use_Metadata_Descriptor_URL"); - validateSignatures.checked = pluginData.config.validateSignature ? pluginData.config.validateSignature : false; - validateSignatures.addEventListener("change", function () { - if (validateSignatures.checked) { - validateSignatures.value = true; - additionalField1.removeAttribute("disabled"); - saml_EntityDescriptor.style.display = 'block'; - Use_Metadata_Descriptor_URL.style.display = 'block'; - } else { - additionalField1.setAttribute("disabled", "true"); - additionalField1.value = ''; - saml_EntityDescriptor.style.display = 'none'; - Use_Metadata_Descriptor_URL.style.display = 'none'; - validateSignatures.value = false; + }); } + } }); - - validateSignatures.dispatchEvent(new Event("change")); - - var UseMetadataDescriptorURL = document.getElementById("UseMetadataDescriptorURL"); - var Validating_X509_Certificates=document.getElementById("Validating_X509_Certificates"); - UseMetadataDescriptorURL.checked = pluginData.config.useMetadataDescriptorUrl ? pluginData.config.useMetadataDescriptorUrl : false; - UseMetadataDescriptorURL.addEventListener("change", function () { - if (UseMetadataDescriptorURL.checked) { - UseMetadataDescriptorURL.value = true; - Validating_X509_Certificates.style.display='none' - } - else { - UseMetadataDescriptorURL.value = false; - Validating_X509_Certificates.style.display='block' - ; - } + }); + + + var validateSignatures = document.getElementById("validateSignatures"); + var additionalField1 = document.getElementById("ValidatingX509Certificates"); + var saml_EntityDescriptor = document.getElementById("saml_EntityDescriptor") + var Use_Metadata_Descriptor_URL = document.getElementById("Use_Metadata_Descriptor_URL") + validateSignatures.value = pluginData.config.validateSignature ? pluginData.config.validateSignature : false; + var validateSignatures = document.getElementById("validateSignatures"); + var additionalField1 = document.getElementById("ValidatingX509Certificates"); + var saml_EntityDescriptor = document.getElementById("saml_EntityDescriptor"); + var Use_Metadata_Descriptor_URL = document.getElementById("Use_Metadata_Descriptor_URL"); + validateSignatures.checked = pluginData.config.validateSignature ? pluginData.config.validateSignature : false; + validateSignatures.addEventListener("change", function () { + if (validateSignatures.checked) { + validateSignatures.value = true; + additionalField1.removeAttribute("disabled"); + saml_EntityDescriptor.style.display = 'block'; + Use_Metadata_Descriptor_URL.style.display = 'block'; + } else { + additionalField1.setAttribute("disabled", "true"); + additionalField1.value = ''; + saml_EntityDescriptor.style.display = 'none'; + Use_Metadata_Descriptor_URL.style.display = 'none'; + validateSignatures.value = false; + } + }); + + validateSignatures.dispatchEvent(new Event("change")); + + var UseMetadataDescriptorURL = document.getElementById("UseMetadataDescriptorURL"); + var Validating_X509_Certificates = document.getElementById("Validating_X509_Certificates"); + UseMetadataDescriptorURL.checked = pluginData.config.useMetadataDescriptorUrl ? pluginData.config.useMetadataDescriptorUrl : false; + UseMetadataDescriptorURL.addEventListener("change", function () { + if (UseMetadataDescriptorURL.checked) { + UseMetadataDescriptorURL.value = true; + Validating_X509_Certificates.style.display = 'none' + } else { + UseMetadataDescriptorURL.value = false; + Validating_X509_Certificates.style.display = 'block' + ; } - - ); - - - var Artifact_Resolution = document.getElementById("Artifact_Resolution"); - Artifact_Resolution.value = pluginData.config.artifactResolution ? pluginData.config.artifactResolution : false; - - Artifact_Resolution.addEventListener("change", function () { - if (Artifact_Resolution.checked) { - Artifact_Resolution.value = true; - additionalField_endpoint.removeAttribute("disabled"); - - } - else { - Artifact_Resolution.value = false; - additionalField_endpoint.setAttribute("disabled", "true"); - additionalField_endpoint.value = ''; - - ; - } + } + ); + + var CustomErrorRedirectEnabled = document.getElementById("customErrorRedirectEnabled"); + var CustomCallbackHiddenConfig = document.getElementById("custom_callback_hidden_config"); + CustomErrorRedirectEnabled.checked = pluginData.config.customErrorRedirectEnabled === true || pluginData.config.customErrorRedirectEnabled === 'true' ; + CustomErrorRedirectEnabled.addEventListener("change", function () { + if (CustomErrorRedirectEnabled.checked) { + CustomErrorRedirectEnabled.value = true; + CustomCallbackHiddenConfig.style.display = 'block'; + } else { + CustomErrorRedirectEnabled.value = false; + CustomCallbackHiddenConfig.style.display = 'none'; } - ); - - - const Sign_Artifact_Resolution_Request = document.getElementById("Sign_Artifact_Resolution_Request"); - Sign_Artifact_Resolution_Request.value = pluginData.config.signArtifactResolutionRequest ? pluginData.config.signArtifactResolutionRequest : false; - Sign_Artifact_Resolution_Request.addEventListener("change", function () { - handleCheckboxValue(Sign_Artifact_Resolution_Request); + } + ); + CustomErrorRedirectEnabled.dispatchEvent(new Event("change")); + + var Artifact_Resolution = document.getElementById("Artifact_Resolution"); + Artifact_Resolution.value = pluginData.config.artifactResolution ? pluginData.config.artifactResolution : false; + + Artifact_Resolution.addEventListener("change", function () { + if (Artifact_Resolution.checked) { + Artifact_Resolution.value = true; + additionalField_endpoint.removeAttribute("disabled"); - }); - - - const Artifact_Resolution_with_SOAP = document.getElementById("Artifact_Resolution_with_SOAP"); - Artifact_Resolution_with_SOAP.value = pluginData.config.artifactResolutionSOAP ? pluginData.config.artifactResolutionSOAP : false; - Artifact_Resolution_with_SOAP.addEventListener("change", function () { - handleCheckboxValue(Artifact_Resolution_with_SOAP); + } else { + Artifact_Resolution.value = false; + additionalField_endpoint.setAttribute("disabled", "true"); + additionalField_endpoint.value = ''; - }); - - - - const Artifact_Resolution_with_XML_header = document.getElementById("Artifact_Resolution_with_XML_header"); - Artifact_Resolution_with_XML_header.value = pluginData.config.artifactResolutionWithXmlHeader ? pluginData.config.artifactResolutionWithXmlHeader : false; - Artifact_Resolution_with_XML_header.addEventListener("change", function () { - handleCheckboxValue(Artifact_Resolution_with_XML_header); - - }); - - - const Mutual_TLS = document.getElementById("Mutual_TLS"); - Mutual_TLS.value = pluginData.config.mutualTls ? pluginData.config.mutualTls : false; - Mutual_TLS.addEventListener("change", function () { - handleCheckboxValue(Mutual_TLS); - - }); - const enabled = document.getElementById("enabled"); - enabled.value = pluginData.enabled ? pluginData.enabled : false; - enabled.addEventListener("change", function () { - handleCheckboxValue(enabled); - - }); - - principalType_input.addEventListener('change', function () { - if (principalType_input.value == "ATTRIBUTE" || principalType_input.value == "FRIENDLY_ATTRIBUTE") { - principalAttribute_input.removeAttribute("disabled"); - - } else { - principalAttribute_input.value = ''; - principalAttribute_input.setAttribute("disabled", "true"); - - } - }) ; + ; + } + } + ); + + + const Sign_Artifact_Resolution_Request = document.getElementById("Sign_Artifact_Resolution_Request"); + Sign_Artifact_Resolution_Request.value = pluginData.config.signArtifactResolutionRequest ? pluginData.config.signArtifactResolutionRequest : false; + Sign_Artifact_Resolution_Request.addEventListener("change", function () { + handleCheckboxValue(Sign_Artifact_Resolution_Request); + + }); + + const ArtifactResolution_via_HTTP_ARTIFACT = document.getElementById("ArtifactResolution_via_HTTP_ARTIFACT"); + ArtifactResolution_via_HTTP_ARTIFACT.value = pluginData.config.artifactResolutionHTTPArtifact ? pluginData.config.artifactResolutionHTTPArtifact : false; + ArtifactResolution_via_HTTP_ARTIFACT.addEventListener("change", function () { + handleCheckboxValue(ArtifactResolution_via_HTTP_ARTIFACT); + + }); + + + const Artifact_Resolution_with_SOAP = document.getElementById("Artifact_Resolution_with_SOAP"); + Artifact_Resolution_with_SOAP.value = pluginData.config.artifactResolutionSOAP ? pluginData.config.artifactResolutionSOAP : false; + Artifact_Resolution_with_SOAP.addEventListener("change", function () { + handleCheckboxValue(Artifact_Resolution_with_SOAP); + + }); + + + const Artifact_Resolution_with_XML_header = document.getElementById("Artifact_Resolution_with_XML_header"); + Artifact_Resolution_with_XML_header.value = pluginData.config.artifactResolutionWithXmlHeader ? pluginData.config.artifactResolutionWithXmlHeader : false; + Artifact_Resolution_with_XML_header.addEventListener("change", function () { + handleCheckboxValue(Artifact_Resolution_with_XML_header); + + }); + + + const Mutual_TLS = document.getElementById("Mutual_TLS"); + Mutual_TLS.value = pluginData.config.mutualTls ? pluginData.config.mutualTls : false; + Mutual_TLS.addEventListener("change", function () { + handleCheckboxValue(Mutual_TLS); + + }); + const enabled = document.getElementById("enabled"); + enabled.value = pluginData.enabled ? pluginData.enabled : false; + enabled.addEventListener("change", function () { + handleCheckboxValue(enabled); + + }); + + principalType_input.addEventListener('change', function () { + if (principalType_input.value == "ATTRIBUTE" || principalType_input.value == "FRIENDLY_ATTRIBUTE") { + principalAttribute_input.removeAttribute("disabled"); + + } else { + principalAttribute_input.value = ''; + principalAttribute_input.setAttribute("disabled", "true"); + + } + }); }); \ No newline at end of file diff --git a/src/main/resources/saml-extended-frontend/js/EditProvider.js b/src/main/resources/saml-extended-frontend/js/EditProvider.js index 514b3c6..125b8b4 100644 --- a/src/main/resources/saml-extended-frontend/js/EditProvider.js +++ b/src/main/resources/saml-extended-frontend/js/EditProvider.js @@ -88,8 +88,10 @@ edit.addEventListener('click', () => { "sendClientIdOnLogout":client_id_in_logout_requests.value, "metadataDescriptorUrl":samlEntityDescriptor_input.value, "useMetadataDescriptorUrl":UseMetadataDescriptorURL.value, - "attributeConsumingServiceMetadata":attributeServicesArray.length > 0 ? JSON.stringify(attributeServicesArray) : undefined - + "attributeConsumingServiceMetadata":attributeServicesArray.length > 0 ? JSON.stringify(attributeServicesArray) : undefined, + "customErrorRedirectEnabled": customErrorRedirectEnabled.value, + "errorCallback": errorCallback_input.value, + "cancelledCallback": cancelledCallback_input.value } }; diff --git a/src/main/resources/saml-extended-frontend/js/Fielders.js b/src/main/resources/saml-extended-frontend/js/Fielders.js index 2796490..719f3c2 100644 --- a/src/main/resources/saml-extended-frontend/js/Fielders.js +++ b/src/main/resources/saml-extended-frontend/js/Fielders.js @@ -43,7 +43,10 @@ var encryption_algorithm=document.getElementById("encryption_algorithm"); var client_id_in_logout_requests_input=document.getElementById("client_id_in_logout_requests"); var samlEntityDescriptor_input=document.getElementById("samlEntityDescriptor"); var storedData; -var UseMetadataDescriptorURL=document.getElementById("UseMetadataDescriptorURL") +var UseMetadataDescriptorURL=document.getElementById("UseMetadataDescriptorURL"); +var customErrorRedirectEnabled=document.getElementById("customErrorRedirectEnabled"); +var errorCallback_input=document.getElementById("errorCallback"); +var cancelledCallback_input=document.getElementById("cancelledCallback"); function handleCheckboxValue(checkbox) { diff --git a/src/main/resources/saml-extended-frontend/js/InfoUpdaterAdd.js b/src/main/resources/saml-extended-frontend/js/InfoUpdaterAdd.js index 5c8ae62..fedb7b1 100644 --- a/src/main/resources/saml-extended-frontend/js/InfoUpdaterAdd.js +++ b/src/main/resources/saml-extended-frontend/js/InfoUpdaterAdd.js @@ -29,7 +29,7 @@ if (storedData) { } - + //Note: Here, the checkboxes are populated from the realm data. toggleCheckbox('backchannelSupported', backchannel) toggleCheckbox('allowCreate', allowCreate) toggleCheckbox('postBindingResponse', httpPostBindingResponse) @@ -53,6 +53,7 @@ if (storedData) { toggleCheckbox1('enabled', enabled) toggleCheckbox('sendIdTokenOnLogout', id_token_hint) toggleCheckbox('sendClientIdOnLogout', client_id_in_logout_requests) + toggleCheckbox('customErrorRedirectEnabled', customErrorRedirectEnabled) if (pluginData.config && pluginData.config.wantAuthnRequestsSigned) { @@ -70,6 +71,14 @@ if (storedData) { } } + if(pluginData.config && pluginData.config.errorCallback) { + updateField('errorCallback', pluginData.config.errorCallback); + } + + if(pluginData.config && pluginData.config.cancelledCallback) { + updateField('cancelledCallback', pluginData.config.cancelledCallback); + } + var additionalField1 = document.getElementById("ValidatingX509Certificates"); if (pluginData.config && pluginData.config.validateSignature) { validateSignatures_value = pluginData.config.validateSignature; diff --git a/src/main/resources/saml-extended-frontend/pages/addprovider.html b/src/main/resources/saml-extended-frontend/pages/addprovider.html index c27b1a0..deb99c6 100644 --- a/src/main/resources/saml-extended-frontend/pages/addprovider.html +++ b/src/main/resources/saml-extended-frontend/pages/addprovider.html @@ -835,6 +835,31 @@
Hide on Login Page +
Custom Callback Behavior + question mark +
+ + + + + +
First Login Flow question mark diff --git a/src/main/resources/saml-extended-frontend/pages/editprovider.html b/src/main/resources/saml-extended-frontend/pages/editprovider.html index c7987d9..01e731b 100644 --- a/src/main/resources/saml-extended-frontend/pages/editprovider.html +++ b/src/main/resources/saml-extended-frontend/pages/editprovider.html @@ -804,6 +804,29 @@
Hide on Login Page +
Custom Callback Behavior + question mark +
+ + +
+
Error Callback + question mark +
+ + +
Cancelled Callback + question mark +
+ +
+
First Login Flow