Oauth 2.0 修改后的Spring Oauth2示例royclarkson github上的BadRequest

Oauth 2.0 修改后的Spring Oauth2示例royclarkson github上的BadRequest,oauth-2.0,spring-security-oauth2,Oauth 2.0,Spring Security Oauth2,为了创建安全的REST Api,我基于以下示例: 问题是,当我尝试获取令牌时,总是会收到错误的凭据 代码是相等的,所以我猜我没有正确地执行访问令牌查询。以下是我的卷发: C:\Users\Javier\Desktop\curl\bin>curl -X POST -vu clientapp:123456 http://localhost:8080/wombee/oauth/token -H "Accept: application/json" -d "password=javi&us

为了创建安全的REST Api,我基于以下示例:

问题是,当我尝试获取令牌时,总是会收到错误的凭据

代码是相等的,所以我猜我没有正确地执行访问令牌查询。以下是我的卷发:

C:\Users\Javier\Desktop\curl\bin>curl -X POST -vu clientapp:123456 http://localhost:8080/wombee/oauth/token -H "Accept: application/json" -d "password=javi&username=javi&grant_type=password&scope=read%20write&client_secret=123456&client_id=clientapp"
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
* Server auth using Basic with user 'clientapp'
> POST /wombee/oauth/token HTTP/1.1
> Host: localhost:8080
> Authorization: Basic Y2xpZW50YXBwOjEyMzQ1Ng==
> User-Agent: curl/7.47.1
> Accept: application/json
> Content-Length: 107
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 107 out of 107 bytes
< HTTP/1.1 400 Petición incorrecta
< Server: Apache-Coyote/1.1
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-Frame-Options: DENY
< Cache-Control: no-store
< Pragma: no-cache
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Fri, 25 Mar 2016 10:52:01 GMT
< Connection: close
<
{"error":"invalid_grant","error_description":"Bad credentials"}* Closing connection 0
C:\Users\Javier\Desktop\curl\bin>curl-X POST-vu客户端:123456http://localhost:8080/wombee/oauth/token -H“接受:应用程序/json”-d“密码=javi&username=javi&grant\u type=password&scope=read%20write&client\u secret=123456&client\u id=clientapp”
注意:不必要地使用-X或--request,POST已经推断出来。
*正在尝试::1。。。
*已连接到本地主机(::1)端口8080(#0)
*对用户“clientapp”使用Basic进行服务器身份验证
>POST/wombee/oauth/token HTTP/1.1
>主机:本地主机:8080
>授权:基本Y2XPZW50YXBWOJYMZQ1NG==
>用户代理:curl/7.47.1
>接受:application/json
>内容长度:107
>内容类型:application/x-www-form-urlencoded
>
*上传完全发送:107个字节中的107个
愚蠢的我,在
CustomUserDetailsService
中,我有
getPassword
方法重写为null,这就是我的问题