Spring安全OAuth– 检查访问令牌的有效性?

Spring安全OAuth– 检查访问令牌的有效性?,第1张

概述我正在关注Spring Security OAuth的示例代码.当我尝试检查令牌时获得访问令牌后curl -X POST http://localhost:9999/uaa/oauth/check_token -d 'token=e3f44c4f-f8f2-45c4-9f9e-c7dd1f583a1f' 我收到以下错误:{'error':'unauthori

我正在关注Spring Security OAuth的示例代码.

当我尝试检查令牌时获得访问令牌后

curl -X POST http://localhost:9999/uaa/oauth/check_token -d "token=e3f44c4f-f8f2-45c4-9f9e-c7dd1f583a1f"

我收到以下错误:

{"error":"unauthorized","error_description":"Full authentication is required to access this resource"}

我尝试传递客户端ID和秘密.

curl -X POST acme:acmesecret@localhost:9999/uaa/oauth/check_token -d "token=e3f44c4f-f8f2-45c4-9f9e-c7dd1f583a1f"

我获得403状态.

{"timestamp":1437683976536,"status":403,"error":"ForbIDden","message":"Access is denIEd","path":"/uaa/oauth/check_token”}

我无法弄清楚出了什么问题.
这里的任何帮助非常感谢.最佳答案尝试通过以下方式使用/ check_token授权权限:

public class OAuthSecurityConfig extends AuthorizationServerConfigurerAdapter {   @OverrIDe    public voID configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {        oauthServer.checkTokenAccess("permitAll()");    }}
总结

以上是内存溢出为你收集整理的Spring安全OAuth – 检查访问令牌的有效性?全部内容,希望文章能够帮你解决Spring安全OAuth – 检查访问令牌的有效性?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/langs/1268606.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存