有誰知道在Spring中實現一個用戶服務或身份驗證提供程序的方式,將接受任何用戶登錄時?春天登錄的任何細節
這進一步爲我剛纔的問題:spring-ws get username & password
我在春天-WS項目基本安全設置:
<security:http auto-config="true">
<security:intercept-url pattern="/**" access="ROLE_USER" />
<security:intercept-url pattern="/*.wsdl" access="ROLE_USER" />
<security:http-basic/>
</security:http>
<security:authentication-manager erase-credentials="false">
<security:authentication-provider user-service-ref="userService">
<security:user-service>
<security:user name="me" password="mypass"
authorities="ROLE_USER" />
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
我不希望在用戶服務指定用戶,我希望具有任何詳細信息的用戶有權訪問,我只是想確保用戶提供用戶名和密碼,並確保我可以從SecurityContextHolder
訪問此信息。
是否有必要實現我自己的用戶服務或認證提供程序來做到這一點,如果有的話,是否有人可以指向示例的方向或提供給我一個?
謝謝!
謝謝,這似乎工作實現我自己的AuthenticationProvider – mpc