Hi!

I'm following problem:

I have JAAS LoginModule that uses JNDI to lookup DataSource object.
My LoginModule and LoginConfiguration implementation classes are located
in Tomcat's classpath. 

I tried first to put JAAS related classes under [TOMCAT-HOME]/common/lib,
but that caused exception:"Unable to load LoginConfiguration".

I'm using JAAS authentication directly from a servlet, so I'm using no
Tomcat realms in authentication.
Servlet just calls:

        LoginContext lc = new LoginContext( jaasApplName,
customUserPasswordCallbackHandler );
        lc.login( );

Everything works fine until LoginModule tries to lookup datasource
after obtaining InitialContext with 

                InitialContext initCtx = new InitialContext( );
                DataSource ds = (javax.sql.DataSource) initCtx.lookup(
dataSourceName );

I got exception with message : "Name MIPCoreDS is not bound in this
context.".

MIPCoreDS is configured in Tomcats configuration file server.xml under
<GlobalNamingResources> tag. 

Should this be visible for JAAS Login module or not?
When servlet's make same lookup under Tomcat, datasource is found fine.
It seems that loginModules have no visibility to JNDI objects configured
under Tomcat. 
Is this right?

Any help is appreciated.

Best Regards,

Aki








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to