2016-03-25 11 views
0

üzerine BadRequest: https://github.com/royclarkson/spring-rest-service-oauthGüvenli bir DİNLENME Api yaratmak için aşağıdaki örnekte dayalı olan modifiye Bahar OAuth2 örneği royclarkson github

sorun olduğunu ben her zaman kötü Kimlik hatası alıyorum jetonu almak çalıştığınızda.

Kod eşittir, bu nedenle tahminim erişim belirteci erişimini düzgün yapmıyorum.

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 

cevap

0

aptalım, ben bir null ile getPassword yöntem geçersiz kılma vardı CustomUserDetailsService yılında, o benim sorun: Aşağıdaki benim bukle olduğunu.

İlgili konular