A robust starter web application to ease Java webapp development.

Home | Tutorials | Demos | Issues

Login using one time password

View: New views
2 Messages — Rating Filter:   Alert me  

Login using one time password

by Thai Son Cung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Matt Raible,

Other that using login page. Is there any other way for user to authenticate?

In my case, user database are pre-populated, so no signup is needed. And user will be send an one-time password to his mobile phone. He can use this one-time password to login for the first time to enable his account and set his password.


Best Regards,  

Tyson Cung
Hello Technology Pte. Ltd. 
180 Cecil Street, #07-03, Bangkok Bank Building, Singapore 069546
(F : +65 6534 7133 (HP : +65 93896675
* tyson.cung@... 



Re: Login using one time password

by Thai Son Cung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI 

I have find out the solution just by checking the otp value and set the security context


UsernamePasswordAuthenticationToken token =

                        new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword(), user.getAuthorities());

                token.setDetails(user);

                SecurityContext context = new SecurityContextImpl();

                context.setAuthentication(token);

                SecurityContextHolder.setContext(context);


Best Regards,
  

Tyson Cung
Hello Technology Pte. Ltd. 
180 Cecil Street, #07-03, Bangkok Bank Building, Singapore 069546
(F : +65 6534 7133 (HP : +65 93896675
* tyson.cung@... 


On Jun 15, 2009, at 4:29 PM, Thai Son Cung wrote:

Hi Matt Raible,

Other that using login page. Is there any other way for user to authenticate?

In my case, user database are pre-populated, so no signup is needed. And user will be send an one-time password to his mobile phone. He can use this one-time password to login for the first time to enable his account and set his password.


Best Regards,  

Tyson Cung
Hello Technology Pte. Ltd. 
180 Cecil Street, #07-03, Bangkok Bank Building, Singapore 069546
(F : +65 6534 7133 (HP : +65 93896675
* tyson.cung@...