You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2024/02/05 07:57:59 UTC

(syncope) branch master updated: [SYNCOPE-1802] provides missing delegated SAML2 IdP configuration parameters (#614)

This is an automated email from the ASF dual-hosted git repository.

fmartelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new caeb361d44 [SYNCOPE-1802] provides missing delegated SAML2 IdP configuration parameters (#614)
caeb361d44 is described below

commit caeb361d44e3597590ebe50e7cc49b0b8622e773
Author: fabio <fa...@tirasa.net>
AuthorDate: Mon Feb 5 08:57:51 2024 +0100

    [SYNCOPE-1802] provides missing delegated SAML2 IdP configuration parameters (#614)
---
 .../common/lib/auth/SAML2IdPAuthModuleConf.java    | 39 ++++++++++++++++++++++
 .../mapping/AuthModulePropertySourceMapper.java    |  4 +++
 2 files changed, 43 insertions(+)

diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SAML2IdPAuthModuleConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SAML2IdPAuthModuleConf.java
index 44ba4dab30..b78b3a2010 100644
--- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SAML2IdPAuthModuleConf.java
+++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SAML2IdPAuthModuleConf.java
@@ -41,6 +41,16 @@ public class SAML2IdPAuthModuleConf extends Pac4jAuthModuleConf implements AuthM
      */
     protected SAML2BindingType destinationBinding = SAML2BindingType.REDIRECT;
 
+    /**
+     * The Service Provider metadata path.
+     */
+    protected String serviceProviderMetadataPath;
+
+    /**
+     * The path to the keystore.
+     */
+    protected String keystorePath;
+
     /**
      * The password to use when generating the SP keystore.
      */
@@ -113,6 +123,11 @@ public class SAML2IdPAuthModuleConf extends Pac4jAuthModuleConf implements AuthM
      */
     protected String nameIdPolicyFormat;
 
+    /**
+     * Whether metadata should be marked to request response signed.
+     */
+    protected boolean responsesSigned;
+
     /**
      * Whether metadata should be marked to request sign assertions.
      */
@@ -197,6 +212,22 @@ public class SAML2IdPAuthModuleConf extends Pac4jAuthModuleConf implements AuthM
         this.destinationBinding = destinationBinding;
     }
 
+    public String getServiceProviderMetadataPath() {
+        return serviceProviderMetadataPath;
+    }
+
+    public void setServiceProviderMetadataPath(final String serviceProviderMetadataPath) {
+        this.serviceProviderMetadataPath = serviceProviderMetadataPath;
+    }
+
+    public String getKeystorePath() {
+        return keystorePath;
+    }
+
+    public void setKeystorePath(final String keystorePath) {
+        this.keystorePath = keystorePath;
+    }
+
     public String getKeystorePassword() {
         return keystorePassword;
     }
@@ -289,6 +320,14 @@ public class SAML2IdPAuthModuleConf extends Pac4jAuthModuleConf implements AuthM
         this.nameIdPolicyFormat = nameIdPolicyFormat;
     }
 
+    public boolean isResponsesSigned() {
+        return responsesSigned;
+    }
+
+    public void setResponsesSigned(final boolean responsesSigned) {
+        this.responsesSigned = responsesSigned;
+    }
+
     public boolean isWantsAssertionsSigned() {
         return wantsAssertionsSigned;
     }
diff --git a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
index 23e0d02116..05e8655c16 100644
--- a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
+++ b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
@@ -276,6 +276,10 @@ public class AuthModulePropertySourceMapper extends PropertySourceMapper impleme
         props.setBlockedSignatureSigningAlgorithms(conf.getBlockedSignatureSigningAlgorithms());
         props.setDestinationBinding(conf.getDestinationBinding().getUri());
         props.getMetadata().setIdentityProviderMetadataPath(conf.getIdentityProviderMetadataPath());
+        props.getMetadata().getServiceProvider().getFileSystem().setLocation(conf.getServiceProviderMetadataPath());
+        props.setKeystorePath(conf.getKeystorePath());
+        props.setWantsAssertionsSigned(conf.isWantsAssertionsSigned());
+        props.setWantsResponsesSigned(conf.isResponsesSigned());
         props.setKeystorePassword(conf.getKeystorePassword());
         props.setMaximumAuthenticationLifetime(conf.getMaximumAuthenticationLifetime());
         props.setNameIdPolicyFormat(conf.getNameIdPolicyFormat());