Actually you should return the return value of plogin.login, like in
@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();
return plogin.login(userNm, pass, "ldapRealm", true);
} catch (Exception ex) {
Logger.getLogger(AuthenticatorAction.class.getName()).log(Level.SEVERE,
null, ex);
return false;
}
}
}
Harsha R A wrote, On Thursday 18 October 2007 03:25 PM:
> 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
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>