【发布时间】:2014-09-02 05:04:56
【问题描述】:
刚刚在我的 Eclipse IDE 中安装了 spring security oauth2。我尝试实施的服务将由第二方用户通过他们安装的应用程序使用,因此我选择使用密码授予类型。根据我对 Oauth2 的理解,以下请求应该适用于演示 sparklr2 服务,而无需我编码用户名和密码参数。即
POST http://localhost:8080/sparklr2/oauth/token?grant_type=password&client_id=my-trusted-client&scope=trust&username=marissa&password=koala
但我不断得到
<oauth>
<error_description>
Full authentication is required to access this resource
</error_description>
<error>unauthorized</error>
</oauth>
我是否在此请求中遗漏了某些内容,或者我是否需要在 repo 中启用某些内容
【问题讨论】:
-
甚至尝试过 curl 客户端凭据授权类型,即 curl -X POST -data "client_id=my-trusted-client&grant_type=password&username=marissa&password=koala" localhost:8080/sparklr2/oauth/token 但我仍然遇到同样的错误
-
sparklr2 项目使用的默认 client_id 和 client_secret 是什么。这是我首先应该问的问题。
标签: spring security oauth passwords