【发布时间】:2016-10-03 10:01:53
【问题描述】:
我在这篇文章https://github.com/angel-git/wso2is-springoauth 中使用 wso2is 服务器做 Spring Boot Security 示例,当我尝试使用访问令牌访问资源时,我得到了
{"error":"unauthorized","error_description":"访问此资源需要完全认证"}
我正在通过以下方式生成访问令牌:
curl -u CLIENT_ID:CLIENT_SECRET -k -d “授予类型=密码&用户名=管理员&密码=管理员”-H “内容类型:应用程序/x-www-form-urlencoded” https://localhost:9443/oauth2/token
并通过以下方式访问资源:
curl -H GET "授权:ACCESS_TOKEN" http://localhost:8080/greeting
我在 stackoverflow 上找到了很多解决方案,但遗憾的是无法解决我的问题
请帮忙,谢谢
【问题讨论】:
-
使用
Authorization: Bearer ACCESS_TOKEN格式发送不记名令牌 -
谢谢回复,我还是遇到同样的问题
-
你用过
curl -H "Authorization: Bearer ACCESS_TOKEN" http://localhost:8080/greeting吗?删除GET -
现在给出 {"error":"access_denied","error_description":"Access is denied"}
-
我猜你没有所需的角色
标签: security spring-boot access-token wso2is