Many thanks to Annegret and Mehrad for their most useful input!

We went OTT for the auth.conf and trying to replicate how a "true" client works with 
JAAS, and
hence trying to have 2 auth.conf.

The MBean Timer is running in the same JVM as JBoss therefore, it already has an 
auth.conf it can
use!

By simply adding in the JBoss/conf/default/auth.conf
client-login {
    org.jboss.security.ClientLoginModule required;
};

and login as follow in the Schedulable class:
     LoginCallback handler = new 
LoginCallback(getUserId(),getPassword().toCharArray());
     localCtx = new LoginContext("client-login", handler);
     localCtx.login();

It is the only thing required...  It became very confusing at some points when we 
introduced
encrypted passwords in DB in one "auth.conf" and not the other one...

Once again, many thanks for your help.  Very appreciated!

regards from London.

Benoit.

> Message: 12
> Subject: Antwort: RE: [JBoss-user] Re: Security Roles not accessible in beans? 
>[Annegret]
> To: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
> Date: Thu, 19 Sep 2002 16:33:58 +0200
> Reply-To: [EMAIL PROTECTED]


> Hi ,
> you are not restricted to use of auth.conf , what JAAS needs , is only
> login modules , which by default are in auth.conf .
> you may redirect it by writting your configuration , and set it as you
> configuration with a command , only once !!

> Configuration.setConfiguration(new MyAuthConfiguration());

and MyAuthConfiguration class could be


import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;

public class MyAuthConfiguration extends Configuration
    {
      public MyAuthConfiguration()
      {
      }

      public AppConfigurationEntry[] getAppConfigurationEntry(String
configid)
               {
                     HashMap options = new HashMap();
           String name = "org.jboss.security.ClientLoginModule";

                      AppConfigurationEntry ace = new
AppConfigurationEntry(name,AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
 options);
                    AppConfigurationEntry[] entry = {ace};
                    return entry;
      }

}


Best regards.







__________________________________________________
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