reset password
Author Message
bseemscs
Posts: 26
Posted 00:39 Aug 20, 2015 |

If we want to use our own user model as the principal object we have to replace the default principal with our own user service implementation, correct? So, if I want to be able to use the get methods like getId and isAdmin etc… I need to do this? That is my understanding.

So then, I implemented UserDetails interface in my User Model and implemented the methods for it including following the example for the getAuthorities() method. Then, tagged with @Service("userService") and created UserDetailsServiceImpl, which only has one method, loadUserByUsername( String arg ), which I implemented by getting the user with getUser( email ) that is in my UserDaoImpl. Finally I put user-service-ref="userService" in the authentication-provider of the applicationContext.xml and that part breaks my app. When I run it with that one little user-service-ref="userService" my app goes from running to 404 /csjobs/ not available. My understanding is user-service-ref="userService" is supposed to replace jdbc-user-service correct? My app runs with jdbc-user-service with its two modified queries. I am able to login and logout but to get the rest of the app working I think I need my own user model as principal. So, what to do here?

cysun
Posts: 2935
Posted 06:12 Aug 23, 2015 |

Most likely your <component-scan> didn't scan the package that contained the userService bean.