Grails / CORS / Spring Security Plugin

Posted 04/11/2018 7:05 AM by Corey Klass

It used to be that when using the Spring Security Plugin with Grails, you needed to include in your build.gradle file a separate plugin for handling CORS requests. In more recent versions of Grails, the functionality is built-in, so you only need to add a configuration item in the application.yml file.

In the first grails section, you need to add the following setting:

grails:
    profile: web
    ... (Other Stuff Here)
    cors:
        enabled: true