You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by mm...@apache.org on 2020/04/01 09:17:59 UTC

[syncope] 02/02: add u2f and radius authn module confs; prep starter

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

mmoayyed pushed a commit to branch SYNCOPE-163-1
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 1a0c0084816badc4668fe921d23d9f5838806cc1
Author: Misagh Moayyed <mm...@gmail.com>
AuthorDate: Wed Apr 1 13:47:37 2020 +0430

    add u2f and radius authn module confs; prep starter
---
 .../common/lib/auth/RadiusAuthModuleConf.java      | 172 +++++++++++++++++++++
 .../common/lib/auth/SAML2IdPAuthModuleConf.java    |   8 +
 .../syncope/common/lib/auth/U2FAuthModuleConf.java |  69 +++++++++
 pom.xml                                            |  10 ++
 wa/starter/pom.xml                                 |   8 +
 5 files changed, 267 insertions(+)

diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/RadiusAuthModuleConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/RadiusAuthModuleConf.java
new file mode 100644
index 0000000..7cd543c
--- /dev/null
+++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/RadiusAuthModuleConf.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.auth;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "radiusAuthModuleConf")
+@XmlType
+public class RadiusAuthModuleConf extends AbstractAuthModuleConf {
+
+    private static final long serialVersionUID = -2235771400318503131L;
+
+    /**
+     * Radius protocol to use when communicating with the server.
+     */
+    private String protocol = "EAP_MSCHAPv2";
+
+    private String inetAddress;
+
+    private String sharedSecret;
+
+    private int socketTimeout;
+
+    private int authenticationPort = 1812;
+
+    private int accountingPort = 1813;
+
+    private int retries = 3;
+
+    private String nasIdentifier;
+
+    private long nasPort = -1;
+
+    private long nasPortId = -1;
+
+    private long nasRealPort = -1;
+
+    private int nasPortType = -1;
+
+    private String nasIpAddress;
+
+    private String nasIpv6Address;
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(final String protocol) {
+        this.protocol = protocol;
+    }
+
+    public int getRetries() {
+        return retries;
+    }
+
+    public void setRetries(final int retries) {
+        this.retries = retries;
+    }
+
+    public String getNasIdentifier() {
+        return nasIdentifier;
+    }
+
+    public void setNasIdentifier(final String nasIdentifier) {
+        this.nasIdentifier = nasIdentifier;
+    }
+
+    public long getNasPort() {
+        return nasPort;
+    }
+
+    public void setNasPort(final long nasPort) {
+        this.nasPort = nasPort;
+    }
+
+    public long getNasPortId() {
+        return nasPortId;
+    }
+
+    public void setNasPortId(final long nasPortId) {
+        this.nasPortId = nasPortId;
+    }
+
+    public long getNasRealPort() {
+        return nasRealPort;
+    }
+
+    public void setNasRealPort(final long nasRealPort) {
+        this.nasRealPort = nasRealPort;
+    }
+
+    public int getNasPortType() {
+        return nasPortType;
+    }
+
+    public void setNasPortType(final int nasPortType) {
+        this.nasPortType = nasPortType;
+    }
+
+    public String getNasIpAddress() {
+        return nasIpAddress;
+    }
+
+    public void setNasIpAddress(final String nasIpAddress) {
+        this.nasIpAddress = nasIpAddress;
+    }
+
+    public String getNasIpv6Address() {
+        return nasIpv6Address;
+    }
+
+    public void setNasIpv6Address(final String nasIpv6Address) {
+        this.nasIpv6Address = nasIpv6Address;
+    }
+
+    public String getInetAddress() {
+        return inetAddress;
+    }
+
+    public void setInetAddress(final String inetAddress) {
+        this.inetAddress = inetAddress;
+    }
+
+    public String getSharedSecret() {
+        return sharedSecret;
+    }
+
+    public void setSharedSecret(final String sharedSecret) {
+        this.sharedSecret = sharedSecret;
+    }
+
+    public int getSocketTimeout() {
+        return socketTimeout;
+    }
+
+    public void setSocketTimeout(final int socketTimeout) {
+        this.socketTimeout = socketTimeout;
+    }
+
+    public int getAuthenticationPort() {
+        return authenticationPort;
+    }
+
+    public void setAuthenticationPort(final int authenticationPort) {
+        this.authenticationPort = authenticationPort;
+    }
+
+    public int getAccountingPort() {
+        return accountingPort;
+    }
+
+    public void setAccountingPort(final int accountingPort) {
+        this.accountingPort = accountingPort;
+    }
+}
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 8a835a6..e3169fd 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
@@ -296,6 +296,14 @@ public class SAML2IdPAuthModuleConf extends AbstractAuthModuleConf {
         this.passive = passive;
     }
 
+    public String getNameIdPolicyAllowCreate() {
+        return nameIdPolicyAllowCreate;
+    }
+
+    public void setNameIdPolicyAllowCreate(final String nameIdPolicyAllowCreate) {
+        this.nameIdPolicyAllowCreate = nameIdPolicyAllowCreate;
+    }
+
     @XmlElementWrapper(name = "authnContextClassRefs")
     @XmlElement(name = "authnContextClassRef")
     @JsonProperty("authnContextClassRefs")
diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/U2FAuthModuleConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/U2FAuthModuleConf.java
new file mode 100644
index 0000000..cc127da
--- /dev/null
+++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/U2FAuthModuleConf.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.auth;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "u2fAuthModuleConf")
+@XmlType
+public class U2FAuthModuleConf extends AbstractAuthModuleConf {
+
+    private static final long serialVersionUID = -1235771400318503131L;
+
+    private long expireRegistrations = 30;
+
+    private String expireRegistrationsTimeUnit = "SECONDS";
+
+    private long expireDevices = 30;
+
+    private String expireDevicesTimeUnit = "DAYS";
+
+    public long getExpireRegistrations() {
+        return expireRegistrations;
+    }
+
+    public void setExpireRegistrations(final long expireRegistrations) {
+        this.expireRegistrations = expireRegistrations;
+    }
+
+    public String getExpireRegistrationsTimeUnit() {
+        return expireRegistrationsTimeUnit;
+    }
+
+    public void setExpireRegistrationsTimeUnit(final String expireRegistrationsTimeUnit) {
+        this.expireRegistrationsTimeUnit = expireRegistrationsTimeUnit;
+    }
+
+    public long getExpireDevices() {
+        return expireDevices;
+    }
+
+    public void setExpireDevices(final long expireDevices) {
+        this.expireDevices = expireDevices;
+    }
+
+    public String getExpireDevicesTimeUnit() {
+        return expireDevicesTimeUnit;
+    }
+
+    public void setExpireDevicesTimeUnit(final String expireDevicesTimeUnit) {
+        this.expireDevicesTimeUnit = expireDevicesTimeUnit;
+    }
+}
diff --git a/pom.xml b/pom.xml
index c8e8790..b740e4f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1579,6 +1579,16 @@ under the License.
       </dependency>
       <dependency>
         <groupId>org.apereo.cas</groupId>
+        <artifactId>cas-server-support-radius</artifactId>
+        <version>${cas.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apereo.cas</groupId>
+        <artifactId>cas-server-support-radius-mfa</artifactId>
+        <version>${cas.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apereo.cas</groupId>
         <artifactId>cas-server-support-saml-idp</artifactId>
         <version>${cas.version}</version>
       </dependency>
diff --git a/wa/starter/pom.xml b/wa/starter/pom.xml
index 144ddf9..f1aecf9 100644
--- a/wa/starter/pom.xml
+++ b/wa/starter/pom.xml
@@ -159,6 +159,14 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apereo.cas</groupId>
+      <artifactId>cas-server-support-radius</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apereo.cas</groupId>
+      <artifactId>cas-server-support-radius-mfa</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apereo.cas</groupId>
       <artifactId>cas-server-support-saml-idp</artifactId>
     </dependency>
     <dependency>