Hi Scott,
 
In fact, I just wan't to know how I could correctly deploy my MyLoginModule, because It
seems that classes from jaas.jar do not find my own class...
For the moment, MyLoginModule class is in the same JAR than my SLSB Authentication.
Do I have to put MyLoginModule in Jboss classpath ? Did I misunderstand something ?
 
Here is a snippet of stacktrace :
 
15:12:09,736 ERROR [STDERR] javax.security.auth.login.LoginException: unable to find LoginModule class: com.myproject.authentication.MyLoginModule
15:12:09,736 ERROR [STDERR]     at javax.security.auth.login.LoginContext.invoke(LoginContext.java:631)
15:12:09,736 ERROR [STDERR]     at javax.security.auth.login.LoginContext.access$000(LoginContext.java:125)
15:12:09,736 ERROR [STDERR]     at javax.security.auth.login.LoginContext$3.run(LoginContext.java:531)
15:12:09,736 ERROR [STDERR]     at java.security.AccessController.doPrivileged(Native Method)
15:12:09,736 ERROR [STDERR]     at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:528)
15:12:09,736 ERROR [STDERR]     at javax.security.auth.login.LoginContext.login(LoginContext.java:449)
15:12:09,736 ERROR [STDERR]     at com.myproject.authentication.AuthenticationBean.authenticate(AuthenticationBean.java:56)
 
Thank you,
 
Sebastien CHAUSSON

----- Original Message -----
Sent: Tuesday, August 20, 2002 9:09 PM
Subject: Re: [JBoss-user] JAAS custom loginModule ?

Start by simply testing your login module outside of the ejb. Once that
is working you need to be printing out the LoginException to see what
is failing.
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Tuesday, August 20, 2002 1:19 PM
Subject: [JBoss-user] JAAS custom loginModule ?

Hi,
 
I'd like to customize JAAS use, but I'm really newbye  and It
doesn't work...
 
First, I created a custom MyLoginModule Class that implements
LoginModule interface (my login() method always returns true for
the moment).
 
I also created a MyCallbackHandler class which will be used to get
a username and a password.
 
Then, I used a stateless session bean in which I have a method :
   
    public boolean authenticate(String username, String password)
    {
        try
        {
           char[] pwd = password.toCharArray();
            LoginContext lc = new LoginContext("MyLogin", new MyCallbackHandler(username, pwd));
            lc.login();
        }
        catch (LoginException le)
        {
            return false;
        }
        return true;
    }
 
Finally, I added following snippet in login-config.xml :
    <application-policy name = "MyLogin">
       <authentication>
          <login-module code="com.myproject.authentication.MyLoginModule"
             flag = "required" />
       </authentication>
    </application-policy>
When I try to connect in my client code, my 'login' method isn't called !!!
 
Any idea ?
 
Sebastien CHAUSSON
 

Reply via email to