Grails Authentication Provider

I am trying to implement my own AuthenticationProvider in a grails project. I am using grails spring plugin for security. However, I am having a problem figuring out how I would get the password from my grails domain class and compare it with the password passed in the argument in order to authenticate. Any help would be greatly appreciated. Thank.


source to share

2 answers

I made a chat and blog post that gave an example of a custom provider:



As I understand it, you are trying to use your own domain class "User" with username, password, etc. In fact, we don't need to override the AuthenticationProvider for this. Instead, you can simply override UserDetailsService. All SpringSecurity needs is that you provide it with UserDetails, it will do the password comparison for you, using the hashing algorithm you specified in the configuration.

See here for details .

If this is not the way I understand it, please add some more code (which you are currently achieving). A bit of code can help you figure it out a lot.



All Articles