【发布时间】:2018-12-02 12:57:12
【问题描述】:
我正在使用 OAuth2 集成开发 Spring REST,以下是详细信息:
春季:4.3.0
Spring 安全性:4.1.0
Sping OAuth:2.3.0
JDK 1.6
部署在 Tomcat 7.0 和 Websphere 7 中。
我能够部署项目并能够访问资源。但是 OAuth 不起作用。在不传递令牌 etccc 的情况下,我能够从 REST 服务获得响应。
控制器: https://gist.github.com/nareshnaredla2424/803b4e3aa0428ecbd36aacd86d47d7c6
AuthorizationServerConfigurerAdapter: https://gist.github.com/nareshnaredla2424/3e9baf2c895045db8b71b57b129392fd
ResourceServerConfigurerAdapter: https://gist.github.com/nareshnaredla2424/2de1fa631fc172b5d2cb2ccab80cb209
WebSecurityConfigurerAdapter: https://gist.github.com/nareshnaredla2424/66473b3e7644bf3fbdcf783a8e73a191
GlobalMethodSecurityConfiguration: https://gist.github.com/nareshnaredla2424/799d9153a1413aecbd49243fe2275dc5
AbstractAnnotationConfigDispatcherServletInitializer : https://gist.github.com/nareshnaredla2424/b64a424ee0f98050e3d5c6c58fa53e27
WebMvcConfigurerAdapter: https://gist.github.com/nareshnaredla2424/b66c35efbafdc8a64843d78455dc8d92
我从几天开始就面临这个问题。
谁能帮我解决这个问题。
谢谢。
【问题讨论】:
-
请帮助任何人。
-
谁能帮帮我
-
Oauth 不工作意味着您可以获得令牌或者您有令牌并且无法验证?你能详细说明你的问题吗?
-
我有一个方法可以接受 GET 请求并以 JSON 形式给出响应。如果我发送 GET 请求,它必须提供错误消息,例如未授权。但我能够直接获得 JSON 响应意味着无需传递令牌。
标签: spring spring-mvc spring-security spring-rest spring-oauth2