我正在从这篇文章 https://github.com/angel-git/wso2is-springoauth 中使用 wso2is 服务器做 Spring Boot Security 的示例,当我尝试使用访问令牌访问资源时,我得到了
{“error”:“unauthorized”,“error_description”:“访问此资源需要完全身份验证”}
我通过以下方式生成访问令牌:
curl -u CLIENT_ID:CLIENT_SECRET-k -d “grant_type=password&username=admin&password=admin” -H “Content-Type:application/x-www-form-urlencoded” https://localhost:9443/oauth2/token
并通过以下方式访问资源:
curl -H GET “授权:ACCESS_TOKEN” http://localhost:8080/greeting
我在 stackoverflow 上找到了很多解决方案,但不幸的是无法解决我的问题
请帮忙,谢谢
原文由 deen 发布,翻译遵循 CC BY-SA 4.0 许可协议
非常感谢帮助我解决问题的 Angel Gavalda。我使用以下命令生成访问令牌和访问资源
对于生成访问令牌:-
访问资源:-