git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@14993 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a28692650e
commit
1841e9e908
|
@ -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!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue