On Thu, Jan 10, 2008 at 09:10:49AM +0100, Jacek Laskowski wrote:
> On Jan 10, 2008 9:05 AM, Jonathan Chen <[EMAIL PROTECTED]> wrote:
>
> > Here's one for the archives: After several iterations of trial and error,
> > it looks like the following configuration will work:
>
> Hi Jonathan,
>
> Can you tell me how you execute your remote app client and where you
> place the jaas configuration? If you could show the jaas-aware code
> snippet where the jaas configuration's used, it'd be superb.
I ran my EjbClient with:
java -Djava.security.auth.login.config=MyApp.jaas -jar MyApp.jar
with MyApp.jaas in the same directory containing:
MyApp
{
org.apache.geronimo.openejb.OpenejbRemoteLoginModule required
org.apache.geronimo.openejb.OpenejbRemoteLoginModule.RemoteSecurityRealm="MyAppRealm"
org.apache.geronimo.openejb.OpenejbRemoteLoginModule.ServerURI="ejbd://localhost:4201";
};
The big trick was finding OpenejbRemoteLoginModule in
geronimo-openejb-2.0.2.jar and pulling the required dependancies.
My EjbClient snippet is pretty simple:
LoginContext
loginCtx = new LoginContext (
"MyApp",
new ClientCallbackHandler ("joeuser", "joespassword"));
loginCtx.login ();
with the ClientCallBackHandler class based on:
http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/tutorials/SampleAcn.java
Cheers.
--
Jonathan Chen <[EMAIL PROTECTED]>
----------------------------------------------------------------------
Don't worry about avoiding temptation,
as you grow older, it starts avoiding you.