我想限制某些休息端點僅適用於特定組中的LDAP用戶。春季啓動ldap組和限制端點
我按照指南https://spring.io/guides/gs/authenticating-ldap/設置了完美工作的LDAP認證。那麼如何限制某些休息終點呢?
我試圖
@PreAuthorize("hasRole('developers')")
@RequestMapping("/foo")
public String foo(HttpServletRequest request) {
return "Welcome to FOO " + request.getRemoteUser();
}
,但它仍然可以讓用戶無法在端點上的開發組訪問
不允許它仍然允許所有用戶訪問/ foo – user971169
如果您更改排序似乎工作。 ()。和()。formLogin()。和()。httpBasic().http://www.autodesk.com/downloads/details.asp );' – user971169