<classpathentry kind="lib" path="lib/gwt-gears.jar"/>
<classpathentry kind="lib" path="ear/lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/gwt-dnd-3.0.1.jar"/>
+ <classpathentry kind="lib" path="ear/lib/ldap.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
License: Creative Commons Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Source code availability: http://www.dolem.com/lytebox/
+
+* Java LDAP
+ License: The OpenLDAP Public License
+ http://www.openldap.org/software/release/license.html
+ Source code availability: http://www.openldap.org/jldap/
\ No newline at end of file
- The GWT Widget project (http://gwt-widget.sourceforge.net/)
- The gwt-google-apis project (http://code.google.com/p/gwt-google-apis/)
- The Lytebox project (http://www.dolem.com/lytebox/)
+ - The OpenLDAP project (http://www.openldap.org/jldap/)
This product includes icons developed by:
- Everaldo Coelho and the Crystal Project (http://www.everaldo.com/crystal/)
--- /dev/null
+Copyright 1998-2005 The OpenLDAP Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted only as authorized by the OpenLDAP
+Public License.
+
+A copy of this license is available in the file LICENSE in the
+top-level directory of the distribution or, alternatively, at
+<http://www.OpenLDAP.org/license.html>.
+
+OpenLDAP is a registered trademark of the OpenLDAP Foundation.
+
+Individual files and/or contributed packages may be copyright by
+other parties and subject to additional restrictions.
+
+This work is derived from the University of Michigan LDAP v3.3
+distribution. Information concerning this software is available
+at <http://www.umich.edu/~dirsvcs/ldap/>.
+
+This work also contains materials derived from public sources.
+
+Additional information about OpenLDAP can be obtained at
+<http://www.openldap.org/>.
+
+---
+Portions Copyright (C) 1999 - 2003 Novell, Inc. All Rights Reserved.
+
+THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND
+TREATIES. USE, MODIFICATION, AND REDISTRIBUTION OF THIS WORK IS SUBJECT
+TO VERSION 2.0.1 OF THE OPENLDAP PUBLIC LICENSE, A COPY OF WHICH IS
+AVAILABLE AT HTTP://WWW.OPENLDAP.ORG/LICENSE.HTML OR IN THE FILE
+"LICENSE-2.0.1" IN THE TOP-LEVEL DIRECTORY OF THE DISTRIBUTION.
+ANY USE OR EXPLOITATION OF THIS WORK OTHER THAN AS AUTHORIZED IN
+VERSION 2.0.1 OF THE OPENLDAP PUBLIC LICENSE, OR OTHER PRIOR WRITTEN
+CONSENT FROM NOVELL, COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND
+CIVIL LIABILITY.
+
--- /dev/null
+The OpenLDAP Public License
+ Version 2.8, 17 August 2003
+
+Redistribution and use of this software and associated documentation
+("Software"), with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions in source form must retain copyright statements
+ and notices,
+
+2. Redistributions in binary form must reproduce applicable copyright
+ statements and notices, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution, and
+
+3. Redistributions must contain a verbatim copy of this document.
+
+The OpenLDAP Foundation may revise this license from time to time.
+Each revision is distinguished by a version number. You may use
+this Software under terms of this license revision or under the
+terms of any subsequent revision of the license.
+
+THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
+CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
+OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+The names of the authors and copyright holders must not be used in
+advertising or otherwise to promote the sale, use or other dealing
+in this Software without specific, written prior permission. Title
+to copyright in this Software shall at all times remain with copyright
+holders.
+
+OpenLDAP is a registered trademark of the OpenLDAP Foundation.
+
+Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
+California, USA. All Rights Reserved. Permission to copy and
+distribute verbatim copies of this document is granted.
onlyRegisterWithCode=false
# An introductory text for the invitation code page.
invitesIntro=You may sign up for the service by submitting the invitation code that you received.
+# The LDAP server where user accounts will be created.
+ldapHost=hal2.ebs.gr
+# The DN to use when connecting to the LDAP server.
+bindDn=cn=Manager,dc=ebs,dc=gr
+# The password to use when connecting to the LDAP server.
+bindPassword=secret
+# The base DN where user accounts will be created.
+baseDn=ou=people,dc=ebs,dc=gr
+# The LDAP objectClass to use for new accounts.
+objectClass=inetOrgPerson
response.sendRedirect(errorUrl);
return;
}
+ try {
+ getService().createLdapUser(username, name, email, password);
+ } catch (Exception exc) {
+ String error = "An error occurred while communicating with the Shibboleth IdP";
+ logger.error(error, exc);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
+ return;
+ }
final UserDTO userDto = new TransactionHelper<UserDTO>().tryExecute(new Callable<UserDTO>() {
@Override
public UserDTO call() throws Exception {
*/
public Invitation findInvite(String code);
+ /**
+ * Create a new user in the connected IdP.
+ *
+ * @param username the username of the new user
+ * @param name the name of the new user
+ * @param email the e-mail of the new user
+ * @param password the password of the new user
+ */
+ public void createLdapUser(String username, String name, String email, String password);
+
}
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
+import com.novell.ldap.LDAPAttribute;
+import com.novell.ldap.LDAPAttributeSet;
+import com.novell.ldap.LDAPConnection;
+import com.novell.ldap.LDAPEntry;
+import com.novell.ldap.LDAPException;
+
/**
* The concrete implementation of the ExternalAPI interface.
*
return dao.findInvite(code);
}
+ @Override
+ public void createLdapUser(String username, String name, String email, String password) {
+ LDAPConnection lc = new LDAPConnection();
+ LDAPAttributeSet attributeSet = new LDAPAttributeSet();
+ attributeSet.add(new LDAPAttribute("objectClass",
+ getConfiguration().getString("objectClass")));
+ attributeSet.add(new LDAPAttribute("uid", username));
+ attributeSet.add(new LDAPAttribute("cn", new String[]{name}));
+ attributeSet.add(new LDAPAttribute("sn", name)); // XXX
+ attributeSet.add(new LDAPAttribute("mail", email));
+ attributeSet.add(new LDAPAttribute("userPassword", password));
+ String dn = "uid=" + username + "," + getConfiguration().getString("baseDn");
+ LDAPEntry newEntry = new LDAPEntry(dn, attributeSet);
+ try {
+ lc.connect(getConfiguration().getString("ldapHost"), LDAPConnection.DEFAULT_PORT);
+ lc.bind(LDAPConnection.LDAP_V3, getConfiguration().getString("bindDn"),
+ getConfiguration().getString("bindPassword").getBytes("UTF8"));
+ lc.add(newEntry);
+ logger.info("Successfully added LDAP account: " + dn);
+ lc.disconnect();
+ } catch(LDAPException e) {
+ throw new RuntimeException(e);
+ } catch(UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
}