springboot+shiro start集成启动报错

报错信息:bean named 'authorizer' that could not be found 

原因是在start中启动SessionsSecurityManager注解@ConditionalOnMissingBean,如果我们写成SecurityManager,自然报错。

 /**
     * @Description: 注意这里需要返回 SessionsSecurityManager 避免 启动报 authoricator not found 错误
     * @param oauth2Realm
     * @Date: 2020/5/14  18:39
     */ 
    @Bean
    @ConditionalOnBean(Oauth2Realm.class)
    public SessionsSecurityManager securityManager(Oauth2Realm oauth2Realm){
        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(oauth2Realm);
        return securityManager;
    }

springboot+shiro start集成启动报错_第1张图片

你可能感兴趣的:(SpringBoot,shiro,java)