users@glassfish.java.net

Custom login module can't read additional property from jdbc realm

From: <forums_at_java.net>
Date: Thu, 19 Jan 2012 11:01:50 -0600 (CST)

Hi,

I have a custom login module and I want to read some additinal properties
from the realm configurations.

custom login module :

public class CustomJDBCLoginModule extends AppservPasswordLoginModule {
protected void authenticateUser() throws LoginException { .....
_logger.info("realm name = " + _currentRealm.getName());
_logger.info("datasource-jndi = " +
_currentRealm.getProperty("datasource-jndi")); *_logger.info("test1 = " +
_currentRealm*.getProperty("test1"));**
domain.xml :

<auth-realm name="custom-ps-realm"
classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm"> <property
name="jaas-context" value="сustomJDBCRealm"></property> ..... <property
name="datasource-jndi" value="jdbc/postgres-db"></property> *<property
name="test1" value="test12345"></property>* </auth-realm>
log file:

INFO: Realm name = custom-ps-realm INFO: datasource-jndi = jdbc/postgres-db
*INFO: test1 = null*
Why the additional properies are null, but the default properties for jdbc
realm are available ?

thanks in advance

 

 

read my default properties for jdbc realm (like a 'datasource-jndi',
'user-table' ...),


--
[Message sent by forum member 'slaveholder']
View Post: http://forums.java.net/node/882837