In Grails 3.3 I was using a custom extension of RestOauthController from spring-security-rest:2.0.0.M2 plugin, which I'd overriden in UrlMappings.groovy like this:
"/oauth/access_token"(controller: "restOauthMy", action: "accessToken", method: "POST")
However, after upgrading to Grails 4, a POST request to /oauth/access_token now leads to the original controller, my RestOauthMyController.accessToken() is never called. Is there a way to get rid of the original URL mapping? More generally, what determines priority of conflicting URL mappings in Grails?
I found a functional workaround adding the URL mapping dynamically in BootStrap.groovy:
This way the dynamic mapping seems to take priority and my overriden code executes.
I would very much like to know how to do this properly, though.