tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J.M. Villagrá <villa...@gmail.com>
Subject Set up a custom LoginModule
Date Fri, 11 Jun 2010 09:39:51 GMT
Hi All,
  We're using openejb to do some tests of our ejbs, but now, i want to use
our custom LoginModule and i dont know how to configure it in openEJB....

  I've created the file openejb.home/config/login.config like this:

TestName {
   com.test.TestLoginModule required debug=true;
};

And, in the context initialization i have this properties:

Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
props.put("openejb.authentication.realmName", "TestName");
props.put("Entities", "new://Resource?type=DataSource");
props.put("Entities.JdbcDriver", "org.postgresql.Driver");
props.put("Entities.JdbcUrl", "jdbc:postgresql://localhost:5432/......");
props.put("Entities.Password", "....");
props.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");

context = new InitialContext(props);

Do i need any other configuration file??
If i try to do a login i get an error:

LoginContext lc = new LoginContext("┬┐TestName?");
lc.login();

javax.security.auth.login.LoginException: No se han configurado LoginModules
para TestName
at javax.security.auth.login.LoginContext.init(LoginContext.java:256)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:334)
at
com.ensenia.server.ejb.SchoolServiceBeanTests.userCrudOperations(SchoolServiceBeanTests.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


Thank you very much.

-- 
Jose

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message