【发布时间】:2015-01-08 23:16:57
【问题描述】:
我正在尝试将 spring-security-oauth2.0 与基于 Java 的配置一起使用。我的配置已经完成,但是当我在 tomcat 上部署应用程序并点击/oauth/token url 获取访问令牌时,Oauth 生成以下错误:
<oauth>
<error_description>Full authentication is required to access this resource</error_description>
<error>unauthorized</error>
</oauth>
我的配置在Git hub, please click on link
代码比较大,参考git。我正在使用 chrome postman 客户端发送请求。以下是我的要求。
POST /dummy-project-web/oauth/token HTTP/1.1
Host: localhost:8081
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=abc%40gmail.com&client_secret=12345678
错误就像,Oauth 的 URL 是安全的,但在配置中,我授予访问此 URL 的所有权限。这个问题究竟是什么?
【问题讨论】:
-
错误是spring框架错误。检查我的答案here。
标签: java oauth-2.0 unauthorized spring-security-oauth2