Hi Annegret,

Many thanks for this!  We managed to login but... It seems a bit convoluted so may be 
you have a
more elegant way to achieve this.  We want to minimise the changes for the JBoss 
installation,
ideally everything should be self contained!

I would be very interested how you have setup you JAAS "auth.conf" 
(java.security.auth.login.config) in the login code!

1/ we put our timer code in a jar, say timer.jar and put timer.jar in JBoss/lib/ext

2/ where did you put the auth.conf that your CLIENT (in timer MBean) needs to access? 

3/ our client! auth.conf is:
client-login {
    org.jboss.security.ClientLoginModule required;
};

4/ the code run by the timer (perform method) is as follows to use JAAS, we HAD to put 
an
auth.conf in JBoss/bin (and that is the ugly bit)
        System.setProperty("java.security.auth.login.config", "auth.conf");
        LoginContext localCtx = null;
        try
        {
            LoginCallback handler = new LoginCallback("user", 
"password".toCharArray());
            localCtx = new LoginContext("client-login", handler);
            localCtx.login();
        }
        catch (LoginException le)
        {
            log.error(le);
        }
        // connects to EJB and call beans ok, userId is "user"
        // everything works fine!

4a/ we have put the auth.conf in the timer.jar and changed the login code to use a 
relative path
to the JBoss/bin directory.

        String authFile = "jar:file:../lib/ext/timer.jar!/auth.conf";
        System.setProperty("java.security.auth.login.config", authFile);

and that works ok.

4b/ we tried to add the client-login in the JBoss/client/auth.conf but that did not 
work...

option 4a/ is self contained and we're fairly happy with it, but may be you have a 
better
solution?
ie a solution that does not depend on the JBoss directory structure or where JBoss is 
started
from...  Is it possible to specify the location of the auth.conf in the current 
classpath?

Once again, many thanks for your help!

Benoit.


> Subject: RE: [JBoss-user] Re: Security Roles not accessible in beans? (Sco
>  tt M Stark)
> Date: Thu, 19 Sep 2002 13:39:49 +0200
> Reply-To: [EMAIL PROTECTED]

> we are using a JAAS login in a MBean (jboss 2.4.3).
> It's working the same way as from the client.
> Important parts:
> create a LoginContext with "client-login"
> in auth.conf of the server check that the configuration for client-login
> exists
> client-login {
>     org.jboss.security.ClientLoginModule required;
> };

> Hope this helps
> Annegret





__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to