I do not inject RdbmsLogin.java because this is JAAS login implementation. The
way I invoke RdbmsLogin is as follow:
in AuthService.java
public class AuthService implements IAuthService{
...
public User authenticate(User user){
...
RdbmsCallbackHandler handler =
new RdbmsCallbackHandler(account, password);
try{
LoginContext context =
new LoginContext(JAAS_REALM, handler);
context.login();
}catch(LoginException le){
le.printStackTrace();
}
...
}
...
}
in RdbmsLogin.java
...
import javax.security.auth.spi.LoginModule;
...
public class RdbmsLogin implements LoginModule{
@Inject
private IAccount accountDAO;
...
public boolean login() throws LoginException {
...
flag = validate(account, password);
...
}
private boolean validate(String account, String password){
...
User user = accountDAO.findUserByAccount(...);
...
}
}
Is there any appropriate place that I can inject RdbmsLogin? I am confused
because the way to invoke JAAS login is done by LoginContext.login(); so as I
understand it won't use RdbmsLogin directly. Or would you please to tell me/ or
give me a hint which place would be appropriate to inject RdbmsLogin?
Many thank you for your help.
--- On Mon, 3/8/09, Thiago H. de Paula Figueiredo <[email protected]> wrote:
> From: Thiago H. de Paula Figueiredo <[email protected]>
> Subject: Re: Tapestry 5 IoC binding interface with impl problem
> To: "Tapestry users" <[email protected]>
> Date: Monday, 3 August, 2009, 11:04 PM
> Em Mon, 03 Aug 2009 19:57:12 -0300,
> neo anderson <[email protected]>
> escreveu:
>
> > Sorry I do not understand very well. What class I need
> to bind with
> > RdbmsLogin?
>
> Shouldn't you inject LoginModule instead of RdbmsLogin?
>
> --Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]