【发布时间】:2017-05-01 11:07:19
【问题描述】:
我已经设置了 spring security 来验证和授权进入我的应用程序的请求。我已经这样设置了配置:
public class OAuth2ServerConfiguration extends ResourceServerConfigurerAdapter {
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
// ...set up token store here
resources.authenticationEntryPoint(new AuthenticationEntryPoint() {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
//QUESTION
// How do I get the destination controller that this request was going to go to?
// Really, I'd like to get some information about the annotations that were on the destination controller.
response.setStatus(401);
}
});
}
我想获取有关此请求将要到达的目标控制器的一些信息。在这种情况下,控制器实际上不会受到影响,因为弹簧安全性在响应到达控制器之前启动并抛出了响应。
有什么建议吗? 谢谢!
【问题讨论】:
标签: java spring spring-security spring-security-oauth2