4 Configuration - Reference Documentation
Authors: Aaron J. Zirbes
Version: 0.9.9
4 Configuration
There are a few configuration options for the "Mock" plugin.This plugin exposes a rather large security hole in your application. It is HIGHLY recommended that you restrict access to your application to localhost when you are using this plugin, and that you only use this plugin in development mode. This can be done with the ipRestrictions configuration parameter.
All of these property overrides must be specified ingrails-app/conf/Config.groovy
using thegrails.plugins.springsecurity
suffix, for examplegrails.plugins.springsecurity.mock.username = 'aaronzirbes'
Name | Default | Meaning |
---|---|---|
mock.active | false | whether the plugin is enabled or not (e.g. to disable per-environment) |
mock.fullName | 'Fake User Account' | the full name of the mock user being automatically logged in |
mock.email | 'fakeexample.org' | the email address of the mock user being automatically logged in |
mock.username | 'fakeuser' | the username of the mock user being automatically logged in |
mock.roles | 'ROLE_USER', 'ROLE_ADMIN' | a collection of roles that will be automatically assigned to the mock user being auto-logged in to your application |
mock.load.dao | false
| whether or not the plugin trys to load roles from GORM instead of the mock.roles@ setting |
Configuration settings from spring-security-ldap that affect the behavior of this pluginIf all three of these settings are configured and enabled, then the Mock plugin will attempt to load roles from LDAP rather than from the
mock.roles
configuration setting.Name | Default | Meaning |
---|---|---|
ldap.active | true | this must be set to true for spring-security-mock to load roles from LDAP |
ldap.authorities.retrieveGroupRoles | true | this must be set to true for spring-security-mock to load roles from LDAP |
ldap.usernameMapper.userDnBase | none, must be set | this must be set to true for spring-security-mock to load roles from LDAP. This will be used to build the userDn that will be used to search LDAP for roles associated with the user. The full DN will be equivalent to "cn=${username},${userDnBase}" |
Using a different User Details Service
You can use any User Details Service with the Mock plugin as long as it implements GrailsUserDetailsService. This is accomplished by setting theuserDetailsService
in your grails-app/conf/spring/resources.groovy
file.For example:beans = { userDetailsService(com.mycompany.myapp.MyUserDetailsService) }