Hi, thanks for your attention, it was mistype (sorry, i also mistyped your 
nickname), code goes as an example of my situation.
jboss-web.xml goes like this: 
... 
<security-role> 
<role-name>Role1</role-name> 
<principal-name>Principal1</principal-name> 
</security-role> 


<servlet-name>action</servlet-name> 
<run-as-principal>Principal1</run-as-principal> 

... 

For the rest i think all correct. So i have not resolved the problem with 
run-as for servlets. 
As for now i get it work like that:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jboss.security.jndi.LoginInitialContextFactory"); 
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://" + strServer + ":1099");
p.put(Context.SECURITY_PRINCIPAL, strLogin);
p.put(Context.SECURITY_CREDENTIALS, strPassword);
p.put(Context.SECURITY_PROTOCOL, "client-login");
InitialContext ctx = new InitialContext(p);
Object home = ctx.lookup(SomeHome.JNDI_NAME);

Where client-login - ClientLoginModule in my login-config.xml, for security 
domain i use configuration with UserRolesLoginModule.
I left all servlets without <run-as>, and it seems to work. But this workaround 
is not suitable for me. Can you help me please how to store principal and 
credential for the application scope, but not for single servlet.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3924613#3924613

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3924613


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to