如何在所有请求中使用表单和HTTP基本身份验证?

时间:2016-06-20 10:36:47

标签: java authentication spring-security

我的问题是首先使用基本身份验证处理所有请求,然后使用自定义表单登录身份验证。

我是从这里来的 Handling both form and HTTP basic authentication with different sources

但我想对所有请求使用双重身份验证

所以我想要实现这样的目标:

<http>
    <intercept-url pattern="/**"  access="isAuthenticated()"/>
<http-basic />

    <intercept-url pattern="/**" access="isAuthenticated()"/>
<form-login 
        login-page="/login" 
        default-target-url="/welcome" 
        authentication-failure-url="/login?error" 
        username-parameter="username"
        password-parameter="password" />
</http>

但我不知道有没有机会这样做。

谢谢。

0 个答案:

没有答案
相关问题