示例Spring OAuth2.0服务器的curl出错?

时间:2017-10-19 17:30:46

标签: java spring spring-security spring-security-oauth2

我正在尝试使用本指南设置示例OAuth2.0服务器。

https://github.com/spring-projects/spring-security-oauth/tree/master/tests/annotation

按照自述文件的说明,我使用以下命令启动服务器:

(126,54)

然而,当我跑

  

curl -H“接受:application / json”   my-client-secret-secret:secret @ localhost:8080 / oauth / token -d   grant_type = client_credentials {...“access_token”:   “b561ff06-4259-466e-92d8-781db1a51901”,...}

我得到了

  

无法解析主机:access_token curl:(6)无法解析主机:   b561ff06-4259-466e-92d8-781db1a51901,

1 个答案:

答案 0 :(得分:1)

错误消息是一个很大的提示。你需要引用你的论点。

阅读on github后,您必须发出的命令是

curl -H "Accept: application/json" my-client-with-secret:secret@localhost:8080/oauth/token -d grant_type=client_credentials

(通常当该行以$开头时,下一个(s)结果是命令