Hello,
I did successifully run the "JAAS how to" examples, I also changed the
login-config.xml to authenticate and authorizate users against my application
datasource.
The problem i have is when i run the same code from a remote Swing application,
following is the code i use:
login-config.xml
| <application-policy name="myapp">
| <authentication>
| <login-module
code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag="required">
| <module-option name="dsJndiName">java:/sqlserver</module-option>
| <module-option name="principalsQuery">select Password from
USERS where USERNAME=?</module-option>
| <module-option name="rolesQuery">select Role, RoleGroup from
USER_ROLES where USERNAME=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
Swing code:
| ...
| env.put(Context.INITIAL_CONTEXT_FACTORY,
resources.getProperty("context.factory","") );
| env.put(Context.PROVIDER_URL, resources.getProperty("provider.url","") );
| env.put(Context.SECURITY_PRINCIPAL, username );
| env.put(Context.SECURITY_CREDENTIALS, password );
| initial = new InitialContext(env);
| Object objref = initial.lookup(USER_SETTING);
| authSuccess = true;
| ....
|
jboss.xml
| <jboss>
| <security-domain>java:/jaas/myapp</security-domain>
| <session>
| <ejb-name>UserSettingManager</ejb-name>
| <jndi-name>UserSettingManager</jndi-name>
| </session>
| </jboss>
|
when I run my application without JAAS it works fine, as i need to gain or deny
access to specific business methods I have to plug JAAS, when i do it I get on
the server side principal=null...
why does that happens?
I tested on other App Server and it works.
Please help.
thank you.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885347#3885347
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885347
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user