I am trying to implement my own AuthenticationProvider in a grails project. I am using the grails spring security core plugin. However, I am having problem understanding how would I get the password from my grails domain class and compare it with the password passed in the argument in order to do the authentication. Any help would be greatly appreciated. Thank you.
Asked
Active
Viewed 5,447 times
2 Answers
6
I did a talk and blog post that included an example of a custom provider here: http://burtbeckwith.com/blog/?p=1090
Burt Beckwith
- 75,342
- 5
- 143
- 156
0
As I understand, you are trying to use your own "User" domain class, with username, password,... and so on. Actually, we don't need to override AuthenticationProvider to do that. You can simply override UserDetailsService instead. All the things SpringSecurity needs is that you provide it with a UserDetails, it will do the password comparison for you, by the hash algorithm you specified in configuration.
For more details, you can refer here.
If it's not like I understand, please add some more code (what you achieve currently). A bit of code may help clear things out a lot.
Community
- 1
- 1
Hoàng Long
- 10,746
- 20
- 75
- 124
-
1Thank you for your reply. However, the problem I had was that I am trying to find a way to bring up the userinformation form the database so that I can compare it to see if the received password is collect. I managed to get a way to do that from @Burt Beckwith comment. But again thank you very much for your time. – Mar 21 '12 at 22:44