diff --git a/oxGwt/pom.xml b/oxGwt/pom.xml index 36702c08..450fb05c 100644 --- a/oxGwt/pom.xml +++ b/oxGwt/pom.xml @@ -7,7 +7,7 @@ org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/oxLdap-annotations/pom.xml b/oxLdap-annotations/pom.xml index 1dd20934..19698645 100644 --- a/oxLdap-annotations/pom.xml +++ b/oxLdap-annotations/pom.xml @@ -7,7 +7,7 @@ org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/oxLdap/pom.xml b/oxLdap/pom.xml index e6ac338c..c3da3779 100644 --- a/oxLdap/pom.xml +++ b/oxLdap/pom.xml @@ -12,7 +12,7 @@ org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/oxLdap/src/main/java/org/gluu/site/ldap/LDAPConnectionProvider.java b/oxLdap/src/main/java/org/gluu/site/ldap/LDAPConnectionProvider.java index 704f4e76..fc277858 100644 --- a/oxLdap/src/main/java/org/gluu/site/ldap/LDAPConnectionProvider.java +++ b/oxLdap/src/main/java/org/gluu/site/ldap/LDAPConnectionProvider.java @@ -26,7 +26,6 @@ public class LDAPConnectionProvider { private static final Logger log = Logger.getLogger(LDAPConnectionProvider.class); - public static final String bindPassword = "bindPassword"; private static final int DEFAULT_SUPPORTED_LDAP_VERSION = 2; private LDAPConnectionPool connectionPool; @@ -34,6 +33,14 @@ public class LDAPConnectionProvider { private int supportedLDAPVersion = DEFAULT_SUPPORTED_LDAP_VERSION; + private String[] servers; + private String[] addresses; + private int[] ports; + + private String bindDn; + private String bindPassword; + private boolean useSSL; + @SuppressWarnings("unused") private LDAPConnectionProvider() {} @@ -59,34 +66,38 @@ public LDAPConnectionProvider(Properties props) { */ public void init(Properties props) throws NumberFormatException, LDAPException, GeneralSecurityException { String serverProp = props.getProperty("servers"); - String[] servers = serverProp.split(","); - String[] addresses = new String[servers.length]; - int[] ports = new int[servers.length]; - for (int i = 0; i < servers.length; i++) { - String str = servers[i]; - addresses[i] = str.substring(0, str.indexOf(":")).trim(); - ports[i] = Integer.parseInt(str.substring(str.indexOf(":") + 1, str.length())); + this.servers = serverProp.split(","); + this.addresses = new String[this.servers.length]; + this.ports = new int[this.servers.length]; + for (int i = 0; i < this.servers.length; i++) { + String str = this.servers[i]; + this.addresses[i] = str.substring(0, str.indexOf(":")).trim(); + this.ports[i] = Integer.parseInt(str.substring(str.indexOf(":") + 1, str.length())); } BindRequest bindRequest = null; if (StringHelper.isEmpty(props.getProperty("bindDN"))) { + this.bindDn = null; + this.bindPassword = null; bindRequest = new SimpleBindRequest(); } else { - bindRequest = new SimpleBindRequest(props.getProperty("bindDN"), props.getProperty(bindPassword)); + this.bindDn = props.getProperty("bindDN"); + this.bindPassword = props.getProperty("bindPassword"); + bindRequest = new SimpleBindRequest(this.bindDn, this.bindPassword); } LDAPConnectionOptions connectionOptions = new LDAPConnectionOptions(); connectionOptions.setConnectTimeoutMillis(100 * 1000); connectionOptions.setAutoReconnect(true); - boolean useSSL = Boolean.valueOf(props.getProperty("useSSL")); + this.useSSL = Boolean.valueOf(props.getProperty("useSSL")).booleanValue(); FailoverServerSet failoverSet; - if (useSSL) { + if (this.useSSL) { SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager()); - failoverSet = new FailoverServerSet(addresses, ports, sslUtil.createSSLSocketFactory(), connectionOptions); + failoverSet = new FailoverServerSet(this.addresses, this.ports, sslUtil.createSSLSocketFactory(), connectionOptions); } else { - failoverSet = new FailoverServerSet(addresses, ports, connectionOptions); + failoverSet = new FailoverServerSet(this.addresses, this.ports, connectionOptions); } connectionPool = new LDAPConnectionPool(failoverSet, bindRequest, Integer.parseInt(props.getProperty("maxconnections"))); @@ -212,4 +223,28 @@ public void setCreationResultCode(ResultCode creationResultCode) { this.creationResultCode = creationResultCode; } + public String[] getServers() { + return servers; + } + + public String[] getAddresses() { + return addresses; + } + + public int[] getPorts() { + return ports; + } + + public String getBindDn() { + return bindDn; + } + + public String getBindPassword() { + return bindPassword; + } + + public boolean isUseSSL() { + return useSSL; + } + } diff --git a/oxSaml/pom.xml b/oxSaml/pom.xml index 5bc9c9f4..fdaba4fb 100644 --- a/oxSaml/pom.xml +++ b/oxSaml/pom.xml @@ -6,12 +6,12 @@ oxSaml oxSaml jar - 1.1.0.Final + 1.2.0.Final org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/oxSaml/src/main/java/org/xdi/saml/AuthRequest.java b/oxSaml/src/main/java/org/gluu/saml/AuthRequest.java similarity index 99% rename from oxSaml/src/main/java/org/xdi/saml/AuthRequest.java rename to oxSaml/src/main/java/org/gluu/saml/AuthRequest.java index 65429471..3ba106bc 100644 --- a/oxSaml/src/main/java/org/xdi/saml/AuthRequest.java +++ b/oxSaml/src/main/java/org/gluu/saml/AuthRequest.java @@ -1,4 +1,4 @@ -package org.xdi.saml; +package org.gluu.saml; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/oxSaml/src/main/java/org/xdi/saml/Response.java b/oxSaml/src/main/java/org/gluu/saml/Response.java similarity index 99% rename from oxSaml/src/main/java/org/xdi/saml/Response.java rename to oxSaml/src/main/java/org/gluu/saml/Response.java index 6a8b5b7c..504dbc37 100644 --- a/oxSaml/src/main/java/org/xdi/saml/Response.java +++ b/oxSaml/src/main/java/org/gluu/saml/Response.java @@ -1,4 +1,4 @@ -package org.xdi.saml; +package org.gluu.saml; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/oxSaml/src/main/java/org/xdi/saml/SamlConfiguration.java b/oxSaml/src/main/java/org/gluu/saml/SamlConfiguration.java similarity index 98% rename from oxSaml/src/main/java/org/xdi/saml/SamlConfiguration.java rename to oxSaml/src/main/java/org/gluu/saml/SamlConfiguration.java index d3660f1c..23b2cdb9 100644 --- a/oxSaml/src/main/java/org/xdi/saml/SamlConfiguration.java +++ b/oxSaml/src/main/java/org/gluu/saml/SamlConfiguration.java @@ -1,4 +1,4 @@ -package org.xdi.saml; +package org.gluu.saml; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; diff --git a/oxService/pom.xml b/oxService/pom.xml index ff5f55f2..6d5347db 100644 --- a/oxService/pom.xml +++ b/oxService/pom.xml @@ -7,7 +7,7 @@ org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfiguration.java b/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfiguration.java index 79be240c..147c4b8d 100644 --- a/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfiguration.java +++ b/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfiguration.java @@ -2,13 +2,15 @@ import java.io.Serializable; +import lombok.Data; + /** * oxTrust configuration * * @author Yuriy Movchan * @version 0.1, 05/15/2013 */ -public final class ApplicationConfiguration implements Serializable { +public final @Data class ApplicationConfiguration implements Serializable { private static final long serialVersionUID = -8991383390239617013L; @@ -81,16 +83,10 @@ public final class ApplicationConfiguration implements Serializable { private String idpLdapServer; private String idpBindDn; private String idpBindPassword; + private String idpUserFields; private String gluuSpCert; - private String vdsLdapProtocol; - private String vdsBindDn; - private String vdsLdapServer; - private String vdsBindPassword; - private String vdsFilter; - private String vdsUserField; - private String mysqlUrl; private String mysqlUser; private String mysqlPassword; @@ -142,6 +138,8 @@ public final class ApplicationConfiguration implements Serializable { private String umaRedirectUri; private String umaResourceId; private String umaScope; + private String cssLocation; + private String jsLocation; public String getBaseDN() { return baseDN; @@ -503,60 +501,20 @@ public void setIdpBindPassword(String idpBindPassword) { this.idpBindPassword = idpBindPassword; } - public String getGluuSpCert() { - return gluuSpCert; - } - - public void setGluuSpCert(String gluuSpCert) { - this.gluuSpCert = gluuSpCert; - } - - public String getVdsLdapProtocol() { - return vdsLdapProtocol; - } - - public void setVdsLdapProtocol(String vdsLdapProtocol) { - this.vdsLdapProtocol = vdsLdapProtocol; - } - - public String getVdsBindDn() { - return vdsBindDn; - } - - public void setVdsBindDn(String vdsBindDn) { - this.vdsBindDn = vdsBindDn; - } - - public String getVdsLdapServer() { - return vdsLdapServer; - } - - public void setVdsLdapServer(String vdsLdapServer) { - this.vdsLdapServer = vdsLdapServer; - } - - public String getVdsBindPassword() { - return vdsBindPassword; + public String getIdpUserFields() { + return idpUserFields; } - public void setVdsBindPassword(String vdsBindPassword) { - this.vdsBindPassword = vdsBindPassword; + public void setIdpUserFields(String idpUserFields) { + this.idpUserFields = idpUserFields; } - public String getVdsFilter() { - return vdsFilter; - } - - public void setVdsFilter(String vdsFilter) { - this.vdsFilter = vdsFilter; - } - - public String getVdsUserField() { - return vdsUserField; + public String getGluuSpCert() { + return gluuSpCert; } - public void setVdsUserField(String vdsUserField) { - this.vdsUserField = vdsUserField; + public void setGluuSpCert(String gluuSpCert) { + this.gluuSpCert = gluuSpCert; } public String getMysqlUrl() { diff --git a/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfigurationFile.java b/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfigurationFile.java index 9407b724..18251de5 100644 --- a/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfigurationFile.java +++ b/oxService/src/main/java/org/xdi/config/oxtrust/ApplicationConfigurationFile.java @@ -180,6 +180,10 @@ public String getIdpBindPassword() { return applicationConfiguration.getString("idp.bindPassword"); } + public String getIdpUserFields() { + return applicationConfiguration.getString("idp.user.fields"); + } + public String getGluuSpCert() { return applicationConfiguration.getString("gluuSP.securityCert"); } @@ -188,30 +192,6 @@ public String getApplianceUrl() { return applicationConfiguration.getString("appliance.url"); } - public String getVdsLdapProtocol() { - return "true".equalsIgnoreCase(applicationConfiguration.getString("vds.useSSL")) ? "ldaps" : "ldap"; - } - - public String getVdsBindDn() { - return applicationConfiguration.getString("vds.bindDN"); - } - - public String getVdsLdapServer() { - return applicationConfiguration.getString("vds.ldap.server"); - } - - public String getVdsBindPassword() { - return applicationConfiguration.getString("vds.bindPassword"); - } - - public String getVdsFilter() { - return applicationConfiguration.getString("vds.test.filter"); - } - - public String getVdsUserField() { - return applicationConfiguration.getString("vds.userField"); - } - public String getMysqlUrl() { return applicationConfiguration.getString("mysql.url"); } @@ -375,5 +355,12 @@ public String getUmaResourceId() { public String getUmaScope() { return applicationConfiguration.getString("uma.scope"); } - + + public String getCssLocation() { + return applicationConfiguration.getString("cssLocation"); + } + + public String getJsLocation() { + return applicationConfiguration.getString("jsLocation"); + } } diff --git a/oxService/src/main/java/org/xdi/model/GluuAttribute.java b/oxService/src/main/java/org/xdi/model/GluuAttribute.java index 1ec54528..ca49dfcb 100644 --- a/oxService/src/main/java/org/xdi/model/GluuAttribute.java +++ b/oxService/src/main/java/org/xdi/model/GluuAttribute.java @@ -1,7 +1,6 @@ package org.xdi.model; import java.io.Serializable; -import java.util.Arrays; import javax.persistence.Transient; import javax.validation.constraints.NotNull; @@ -31,7 +30,22 @@ @LdapAttribute(ignoreDuringUpdate = true) private String inum; - + + @LdapAttribute(name = "oxAttributeType") + private String type; + + @LdapAttribute + private String lifetime; + + @LdapAttribute(name = "oxSourceAttribute") + private String sourceAttribute; + + @LdapAttribute + private String salt; + + @LdapAttribute(name = "oxNameIdType") + private String nameIdType; + @NotNull @Pattern(regexp = "^[a-zA-Z_]+$", message = "Name should contain only letters and underscores") @Size(min = 1, max = 30, message = "Length of the Name should be between 1 and 30") diff --git a/oxUtil/pom.xml b/oxUtil/pom.xml index 66d095b7..005d0f0c 100644 --- a/oxUtil/pom.xml +++ b/oxUtil/pom.xml @@ -7,7 +7,7 @@ org.xdi oxCore - 1.1.0.Final + 1.2.0.Final diff --git a/pom.xml b/pom.xml index 281a08c9..0abb852f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.xdi oxCore pom - 1.1.0.Final + 1.2.0.Final oxCore http://ox.gluu.org