開發了一個Spring集成項目,其中我實現了Spring的安全性。配置很好。當我打到給定的URL(eglocalhost:8080/test/api )來獲取響應,spring-security應該攔截請求並使用spring安全進行身份驗證。URL在Spring集成中沒有被Spring Security攔截
<http auto-config="true" create-session="never" >
<intercept-url pattern="/api/" access="ROLE_USER" />
<http-basic entry-point-ref="basicAuthenticationEntryPoint" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="customAuthenticationProvider">
</authentication-provider>
</authentication-manager>
以上是彈簧安全的基本配置。
Thanx提前。