I need to be able to change a user’s password as an admin user, sort of like a manual password reset feature that can be performed over the phone. How would I do this using the Grails Spring Security plugin? I tried looking for documentation on how this can be accomplished but didn’t come up with anything.
Share
@AA’s answer is technically correct, but over-generic because the plugin has to be configuration-based. The real code would be a lot more compact since you can hard-code the class and field names. Also since you only asked to update the password, the role updates at the end aren’t relevant.
If your user class name is
Userthen use this action to display the user information:and configure the form in the GSP (it’d be similar to the generated
edit.gsp) to post to this action:Change
userIdandnewPasswordto whatever parameter names you’re actually using