grails-spring-security-mock - >没有名为'ldapAuthProvider'的bean被抛出

时间:2014-03-24 22:34:33

标签: grails spring-security integration-testing grails-2.0 grails-plugin

我正在使用" Mock authentication support for Spring Security"使用以下配置:

  1. Grails 2.3.2
  2. JDK 1.6
  3. 弹簧安全核:1.2.7.3
  4. 弹簧安全模拟:1.0.3
  5. 我的Config.groovy有以下条目 - >

    grails.plugins.springsecurity.providerNames = [
            'anonymousAuthenticationProvider',
            'rememberMeAuthenticationProvider',
            'daoAuthenticationProvider',
            'ldapAuthProvider']
    
    grails.plugins.springsecurity.ldap.active = false
    grails.plugins.springsecurity.ldap.authorities.retrieveGroupRoles = false
    grails.plugins.springsecurity.ldap.usernameMapper.userDnBase = false
    
    //Configuration changes to accommodate plugin for mocking spring security
    grails.plugins.springsecurity.mock.active = true
    grails.plugins.springsecurity.mock.fullName = 'User A'
    grails.plugins.springsecurity.mock.email = 'user_a@gmail.com'
    grails.plugins.springsecurity.mock.username = 'user_a'
    grails.plugins.springsecurity.mock.roles = ['ROLE_USER', 'ROLE_ADMIN']
    grails.plugins.springsecurity.mock.load.dao = false
    

    但是,当我运行我的集成测试(扩展spock.lang.Specification)时,我得到以下错误 - > 运行测试的致命错误:没有名为& ddapAuthProvider'已定义(注意:已过滤堆栈跟踪。使用--verbose查看整个跟踪。) org.springframework.beans.factory.NoSuchBeanDefinitionException:没有名为< ldapAuthProvider'已定义

    我错过了什么?

1 个答案:

答案 0 :(得分:0)

LDAP插件:http://grails.org/plugin/spring-security-ldap - 核心插件中不支持LDAP。