PDA

View Full Version : Programmatic authentication



krm
Jan 26th, 2005, 12:26 PM
How i can manually perform user logon?
I mean next scenario:
1. User fills registration form and clicks Submit
2. Application performed validation of entered info and created new record in DB
3. User now must be inside (in secured area)

So, registration handler knows only user login and password and doesnt know anything about user credentials. And now with this i need to initiate user authentication

Ben Alex
Jan 27th, 2005, 07:05 AM
I am understanding this as you have a sign-up workflow, and at the end of the workflow the user should be automatically logged in.

In this case your easiest approach is to have your sign-up workflow controller create the user record, then create an Authentication object containing the username and password of the record just created. Put the Authentication into the ContextHolder, and that is it. At the end of the web request, the HttpSessionIntegrationFilter will copy the Authentication object out of the ContextHolder and into the HttpSession, ready for next request.

krm
Jan 31st, 2005, 08:56 AM
Can you provide example?

Trevor O'Reilly
Feb 1st, 2005, 07:02 PM
See http://forum.springframework.org/showthread.php?t=12101