My application is based on Spring 3, Hibernate 3, MySQL. I read the Spring Security document and learnt that I can implement Authentication as given below,
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="
select username,password, enabled
from users where username=?"
authorities-by-username-query="
select u.username, ur.authority from users u, user_roles ur
where u.user_id = ur.user_id and u.username =? "
/>
</authentication-provider>
</authentication-manager>
I understood above part but my concern is, in my application user table doesn't only store the userName, password and enabled field. It also stores first and last name, emailID, phone etc. On successful authentication, I want next jsp to populate all user details automatically and not ask user the same information which it will ask to non-regirstered user.
- I want to use annotation based configuration and not xml based (unlike mentioned in spring 2.5 examples)
- spring document doesnt use hibernate for security. Should i use hibernate or jdbc-user-service? if hibernate then how?
- I saw couple of examples use customized UserService. Is that I need to do as well?
Can someone kindly advice with good examples? any references to other posts will help too.