Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.4
-
Fix Version/s: 0.4
-
Component/s: None
-
Labels:None
Description
All is fine when an app using jsecurity plugin has a realm in grails-app\realm
Since I would like to have my realm (credential matcher, custom auth token etc) reusable by non-grails application I have put it in a separate project and configure the custom realm in resources.groovy of my app.
This way I do not need any realm in grails-app\realm as I have a custom native realm but this results in problem for following reasons:
In JsecurityGrailsPlugin.groovy
1/ in doWithSpring,
while configuring jsecSecurityManager bean the realms are specified. These realms are the ones in grails-app\realm. Since there are none this setting results in an exceptions. Jsecurity does not want apps to set the empty collection as realms.
2/ in doWithApplicationContext,
the native realms are added to the jsecuritymanager realms collections. But since realms are null you would get null pointer exception while adding them.
##
I have been able to successfully modify the plugin for the above mentioned problems.
Please find attached the modified JsecurityGrailsPlugin.groovy file
Thanks for the patch.