[jboss-user] [Security & JAAS/JBoss] - Re: Simple Auth for HelloWorld-Example not working...

j0llyr0g3r do-not-reply at jboss.com
Tue Jun 24 09:11:04 EDT 2008


Ok, 

i found the solution:

First of all for a single ejb.jar:

I had used the wrong INITIAL_CONTEXT_FACTORY,  so now the corresponding line in my client looks like this:

props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.security.jndi.JndiLoginInitialContextFactory");

Furthermore we have to adjust the jndi-adress since now we want to talk to a jar-application and not to a full-fledged ear-application:

ISayHello iSayHello = (ISayHello) ctx.lookup("SayHello/remote");

jar-Modifications:

- The sourcecode stays the same.
- pack the users.properties, roles.properties and the ejb-jar.xml under the jar's META-INF
- create the file jboss.xml under the jar's META-INF:

<jboss> 
  |   <security-domain>java:/jaas/SayHello</security-domain> 
  | </jboss> 

That's it!

I will update this section when i have figured out how to do the same for an EAR....

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

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



More information about the jboss-user mailing list