diff --git a/test-suite/authentication/UserAuthentication.java b/test-suite/authentication/UserAuthentication.java new file mode 100644 index 0000000..5e4a53b --- /dev/null +++ b/test-suite/authentication/UserAuthentication.java @@ -0,0 +1,29 @@ +package asl.authentication; + +import org.gcube.application.framework.core.security.LDAPAuthenticationModule; + +public class UserAuthentication { + + + + public static void main(String[] args) { + + System.setProperty("java.security.auth.login.config", "jaas.config"); + //put real username - password here + String userName = "username"; + String userPassword = "password"; + boolean authenticated = false; + LDAPAuthenticationModule lala = new LDAPAuthenticationModule(); + try { + authenticated = lala.checkAuthentication(userName, userPassword); + } catch (Throwable all) { + all.printStackTrace(); + } + + if (authenticated) + System.out.println("The user exists"); + else + System.out.println("The user doesn't exist!"); + } + +} diff --git a/test-suite/readme.txt b/test-suite/readme.txt new file mode 100644 index 0000000..9191034 --- /dev/null +++ b/test-suite/readme.txt @@ -0,0 +1,16 @@ +TEST SUITE FOR THE ASL CORE +----------------------------------------------------------- +-Author +* Rena Tsantouli (e.tsantoylh@di.uoa.gr) + +User Authentication: + +-Build + +Dependencies: ApplicationSupportLayerCore.jar and (runtime dependencies): commons-logging.jar, jboss-common.jar, jbosssx.jar included with a standard JBoss Application Server. + +-Set the System property "java.security.auth.login.config" pointing to the location where the configuration file "jaas.config" is placed. + + + + \ No newline at end of file