Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 将安全xml转换为代码_Spring_Spring Mvc_Spring Security - Fatal编程技术网

Spring 将安全xml转换为代码

Spring 将安全xml转换为代码,spring,spring-mvc,spring-security,Spring,Spring Mvc,Spring Security,我有一个如下的xml代码 <http auto-config="false" use-expressions="true" create-session="ifRequired" entry-point-ref="loginUrlAuthenticationEntryPoint"> <custom-filter position="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter" />

我有一个如下的xml代码

<http auto-config="false" use-expressions="true" create-session="ifRequired" entry-point-ref="loginUrlAuthenticationEntryPoint">
        <custom-filter position="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter" />
        <custom-filter before="PRE_AUTH_FILTER" ref="socialAuthenticationFilter"  />
        <intercept-url pattern="/blah/404-error" access="permitAll()" />
        <intercept-url pattern="/blah/500-error" access="permitAll()" />
        <intercept-url pattern="/**" access="isAuthenticated()" />
        <remember-me services-ref="rememberMeServices" key="blah" />
        <logout logout-url="/blah/logout" logout-success-url="/blah/signin" />
    </http>



<beans:bean id="authenticationProcessingFilter" class="in.security.ReCaptchaAuthenticationFilter">
        <beans:property name="authenticationManager" ref="authenticationManager" />
        <beans:property name="filterProcessesUrl" value="/blah/authentication" />
        <beans:property name="authenticationSuccessHandler" ref="authenticationSuccessHandler" />
        <beans:property name="authenticationFailureHandler" ref="authenticationFailureHandler" />
        <beans:property name="privateKey" value="key" />
    </beans:bean>
我通常可以看到示例代码包含以下内容

auth
        .inMemoryAuthentication()
            .withUser("user").password("password").roles("USER").and()
            .withUser("admin").password("password").roles("USER", "ADMIN");

但我既不使用内存身份验证,也不使用jdbc身份验证。但我没有使用任何这种身份验证。我正在使用过滤器。。。。
我不知道在
configureGlobal
方法中应该放什么。

您可以发布
authenticationProcessingFilter
定义吗?更新了过滤器定义
auth
        .inMemoryAuthentication()
            .withUser("user").password("password").roles("USER").and()
            .withUser("admin").password("password").roles("USER", "ADMIN");
auth
        .jdbcAuthentication()
            .dataSource(dataSource)
            .withDefaultSchema()
            .withUser("user").password("password").roles("USER").and()
            .withUser("admin").password("password").roles("USER", "ADMIN");