Sep 21st, 2010, 08:40 AM
Redirect after login
I've implemented OpenID authentication via Google accounts. After authentication, I would like to ask user for username (sometimes login from email is not the best) and process post-registration with captcha.
Any idea how to do it ? Maybe some filter or something ?
Nov 8th, 2010, 04:06 AM
Did you find some solution for this?
I'm having a similar scenario where I want to ask the authenticated user (e.g. twitter) to supply more user data.
Nov 8th, 2010, 04:13 AM
No... I've no idea how to implement this :-/
Nov 8th, 2010, 04:22 AM
To bad, hope somebody knows.
I'm struggling with customizing Spring Security..
Nov 8th, 2010, 08:31 AM
Have you taken a look at the OpenID sample in master? It will automatically provision a user if they do not exist. It should be fairly trivial to modify the sample to your needs.
Nov 8th, 2010, 09:10 AM
Thanks for reply rwinch,
Yes I looked at the examples.
In the openid example I can see a custom registeringUserService is used.
But how can I use that one to redirect to a certain page.
Nov 8th, 2010, 09:09 PM
You could create a custom AuthenticationSuccessHandler that looks to see if the user is marked as new. If it is, redirect the user to the captcha. You will likely want to prevent the user from actually getting registered until they solve the captcha. You could do this by not saving the user until the captcha is solved. At that time you could update the property to state the user is not new. Additionally, you will probably want to ensure the user is not allowed to access the application unless they have solved the captcha. You can do this by not allowing access if the user is new.