bluesliverx / grails-spring-security-oauth2-provider

Grails Spring Security OAuth2 Provider Plugin
http://grails.org/plugin/spring-security-oauth2-provider
57 stars 58 forks source link

Loading plugin breaks configuration parsing with `GrailsConfigurationAware` #138

Closed joemccall86 closed 5 years ago

joemccall86 commented 7 years ago

Example application:

https://github.com/joemccall86/config-parse-test

I have configuration in application.yml that sets a value to '${MY_APP_VALUE:default_value}'. When I include the plugin in my application, my service class that implements GrailsConfigurationAware reads the value incorrectly.

Expected: both co.getProperty('myApp.value') and co.myApp.value return 'default_value' Actual: co.getProperty('myApp.value') returns the literal string '${MY_APP_VALUE:default_value}' while co.myApp.value returns 'default_value'

I'm not exactly sure what in the plugin would be causing this. I did notice if I set grails.plugin.springsecurity.active: false in application.yml it works as expected, but if I set grails.plugin.springsecurity.oauthProvider.active: false it exhibits the broken behavior. I suspect the culprit is in SpringSecurityOauth2ProviderGrailsPlugin.groovy:589 where the secondary config is loaded.

joemccall86 commented 7 years ago

May be related to https://github.com/grails-plugins/grails-spring-security-core/issues/492

ddelponte commented 6 years ago

It looks like the bug resides in grails core.

I've created a new issue in grails-core to fix the bug: https://github.com/grails/grails-core/issues/11042