Jan 4th, 2006, 08:01 AM
Combined id on user table in stead of userid
I have an application where I have many clients. I changed the user table and added a column called client_id.
How can I get Acegi to look for the combination of userid and client_id in stead of only userid when authenticating?
My problem is that the userid is unique in the whole application today and I would like to have the combination to be unique in stead.
Last edited by tborum; Jan 4th, 2006 at 08:12 AM.
Jan 4th, 2006, 09:14 AM
First question is why do you want that? This way users can have the same userid? Do users have to logon with userid and clientid than? As for the answer, what kind of provider are you using? Are you using the JdbcDaoImpl?
In short, please provide more details
Jan 25th, 2006, 07:20 PM
I have done this plenty of times in ASP style deployments.
A bit of an intro is at http://forum.springframework.org/showthread.php?t=9830
Basically you need to select an identifier, then in your UserDetailsService you need to tokenize the Authentication.getPrincipal() so you get the two components out. See org.springframework.util.StringUtils for helpful methods.