【发布时间】:2016-12-26 23:22:25
【问题描述】:
我想将某些休息端点限制为仅适用于某个组中的 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();
}
但它仍然允许不在开发者组中的用户访问该端点
【问题讨论】:
标签: java rest spring-security spring-boot ldap