首页 > 解决方案 > 带有 UAA 服务器的 OAuth 客户端 webapp - error="access_denied", error_description="Error requesting access token."

问题描述

我正在从这个https://github.com/cfid/uaa-samples/tree/master/basic-java-client运行 OAuth 客户端 当我尝试访问该应用程序时,它会将我重定向到 UAA 登录页面。输入凭据后,出现以下错误:

error="access_denied", error_description="请求访问令牌时出错。"

查看我的客户端 webapp 上的日志,我看到以下内容:

-- AuthorizationCodeAccessTokenProvider:编码和发送形式:{grant_type= [authorization_code], code=[S9uXYsvgn4], redirect_uri=[ http://localhost:8081/sampleapp/login] } [2018-07-29 15:23:38.759]样本/应用程序 - ???? [http-nio-8081-exec-4] .... WARN - -- RestTemplate: POST 请求“ http://localhost:8080/uaa/oauth/token ”导致 401(空);调用错误处理程序

我不确定问题是什么。看起来在对 oauth/token 的调用中,它还应该发送 client_id 和 client_secret?但从上面的日志来看,它似乎没有发送它们。是这个问题吗?如果是,为什么不发送这些参数?有任何想法吗?

标签: springspring-securityoauthoauth-2.0cloudfoundry-uaa

解决方案


推荐阅读