users@glassfish.java.net

Re: Seam security framework in Glassfish

From: Harsha R A <Harsha.Ra_at_Sun.COM>
Date: Thu, 18 Oct 2007 15:25:00 +0530

It is possible. Let me know if you have any problems with it. Instead of
the default way of authentication from the
AuthenticatorAction.authenticate() you can use ProgrammaticLogin. For eg,


@Stateless
@Name("authenticator")
public class AuthenticatorAction implements Authenticator, Serializable
{
   @PersistenceContext EntityManager em;
  
   @Out(required=false, scope = SESSION)
   private User user;
  
   public boolean authenticate()
   {
        try {
            String userNm = Identity.instance().getUsername();
            String pass = Identity.instance().getPassword();
            ProgrammaticLogin plogin = new ProgrammaticLogin();

            plogin.login(userNm, pass, "ldapRealm", true);
        } catch (Exception ex) {
            
Logger.getLogger(AuthenticatorAction.class.getName()).log(Level.SEVERE,
null, ex);
            return false;
        }
        return true;
   }

}


Thanks
Harsha

glassfish_at_javadesktop.org wrote, On Wednesday 17 October 2007 07:29 PM:
> Hello, all
> I want to use JBoss Seam built-in identity component authentication against
> Glassfish built-in security realm (for example fileRealm). Is it possible?
> [Message sent by forum member 'slavach' (slavach)]
>
> http://forums.java.net/jive/thread.jspa?messageID=240665
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>