Posted on Sep - 2017by krishna singh
Upgrading spring security rest for grails 3.3.x with mongodb.
Grails has come up with the latest version of 3.3.x and with this new release lot of changes are made to improve the overall performance of grails application.
In this blog we will look into the changes required to make the spring security core and spring security rest work with mongdb.
1. First of all starting from grails 3.3.x , we need to compile the below mentioned spring security core plugin.
2. For next set of configuration you can follow my old post on grails spring security core and rest mentioned below.
- Grails 3 with MongoDB and Spring Security Core Step By Step
- Grails 3 Spring Security Rest Mongodb Step by Step
3. Most important step, you will notice a new file created under src/main/groovy/com/yourapp.SecUserPasswordEncoderListener.groovy file, this file is an event listener file used to encode the password before saving it to the database. Along with this file you will also notice file change under conf/spring/resources.groovy file, changes would look similar to code mentioned below.
Just update the hibernateDataStore to mongoDatastore and your password encoder will start working.