Index: lams_build/conf/unix/authentication/lamsauthentication.xml =================================================================== diff -u -r4e96134b3cbfa0ee095029f40d528d821a6e2dd9 -r55268a5d8e4842b3b6ffa412207587b0f9950e76 --- lams_build/conf/unix/authentication/lamsauthentication.xml (.../lamsauthentication.xml) (revision 4e96134b3cbfa0ee095029f40d528d821a6e2dd9) +++ lams_build/conf/unix/authentication/lamsauthentication.xml (.../lamsauthentication.xml) (revision 55268a5d8e4842b3b6ffa412207587b0f9950e76) @@ -5,16 +5,24 @@ com.sun.jndi.ldap.LdapCtxFactory - ldap://mams.melcoe.mq.edu.au:636 + ldap://192.168.111.35 simple - ssl - uid= - ,ou=mams,dc=melcoe,dc=mq,dc=edu,dc=au - java:/MySqlDS + cn= + ,dc=melcoe,dc=local + java:/jdbc/lams-ds select password from lams_user where login=? - select name,'Roles' from lams_role, lams_user where login=? + + SELECT DISTINCT r.name,'Roles' FROM + lams_user u LEFT OUTER JOIN lams_user_organisation uo USING(user_id) + LEFT OUTER JOIN lams_user_organisation_role urr USING(user_organisation_id) + LEFT OUTER JOIN lams_role r USING (role_id) + WHERE u.login=? + + Index: lams_build/conf/windows/authentication/lamsauthentication.xml =================================================================== diff -u -r4e96134b3cbfa0ee095029f40d528d821a6e2dd9 -r55268a5d8e4842b3b6ffa412207587b0f9950e76 --- lams_build/conf/windows/authentication/lamsauthentication.xml (.../lamsauthentication.xml) (revision 4e96134b3cbfa0ee095029f40d528d821a6e2dd9) +++ lams_build/conf/windows/authentication/lamsauthentication.xml (.../lamsauthentication.xml) (revision 55268a5d8e4842b3b6ffa412207587b0f9950e76) @@ -5,12 +5,11 @@ com.sun.jndi.ldap.LdapCtxFactory - ldap://mams.melcoe.mq.edu.au:636 + ldap://192.168.111.35 simple - ssl - uid= - ,ou=mams,dc=melcoe,dc=mq,dc=edu,dc=au - java:/MySqlDS + cn= + ,dc=melcoe,dc=local + java:/jdbc/lams-ds select password from lams_user where login=? SELECT DISTINCT r.name,'Roles' FROM @@ -19,8 +18,11 @@ LEFT OUTER JOIN lams_role r USING (role_id) WHERE u.login=? + Index: lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r55268a5d8e4842b3b6ffa412207587b0f9950e76 --- lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java (.../LDAPAuthenticator.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_central/src/java/org/lamsfoundation/lams/security/LDAPAuthenticator.java (.../LDAPAuthenticator.java) (revision 55268a5d8e4842b3b6ffa412207587b0f9950e76) @@ -70,7 +70,6 @@ // Load all authentication method parameters into env env.setProperty(Context.INITIAL_CONTEXT_FACTORY, method.getParameterByName(Context.INITIAL_CONTEXT_FACTORY).getValue()); env.setProperty(Context.SECURITY_AUTHENTICATION, method.getParameterByName(Context.SECURITY_AUTHENTICATION).getValue()); - env.setProperty(Context.SECURITY_PROTOCOL, method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); String principalDNPrefix = method.getParameterByName(PRINCIPAL_DN_PREFIX_OPT).getValue(); String principalDNSuffix = method.getParameterByName(PRINCIPAL_DN_SUFFIX_OPT).getValue(); @@ -79,19 +78,26 @@ env.setProperty(Context.PROVIDER_URL, method.getParameterByName(Context.PROVIDER_URL).getValue()); env.put(Context.SECURITY_CREDENTIALS, credential); - + Object originalTrustStore = System.getProperty("javax.net.ssl.trustStore"); Object originalTrustPass = System.getProperty("javax.net.ssl.trustStorePassword"); - //FIXME: synchronization issue: dynamically load certificate into - // system instead of overwritting it. - System.setProperty("javax.net.ssl.trustStore", method.getParameterByName("truststore.path").getValue()); - System.setProperty("javax.net.ssl.trustStorePassword", method.getParameterByName("truststore.password").getValue()); + + // optional parameters + try { + env.setProperty(Context.SECURITY_PROTOCOL, method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); + log.debug("security.protocol: "+method.getParameterByName(Context.SECURITY_PROTOCOL).getValue()); + // FIXME: synchronization issue: dynamically load certificate into + // system instead of overwritting it. + System.setProperty("javax.net.ssl.trustStore", method.getParameterByName("truststore.path").getValue()); + System.setProperty("javax.net.ssl.trustStorePassword", method.getParameterByName("truststore.password").getValue()); + } catch(NullPointerException e) { + } log.debug("===> LDAP authenticator: " + env); InitialLdapContext ctx = null; try { - ctx = new InitialLdapContext(env, null); + ctx = new InitialLdapContext(env, null);System.out.println(ctx); log.debug("===> ldap context created: "+ctx); return true; } catch (Exception e) {