gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 12:06:57 25 4
gpt4 key购买 nike

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

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

按照自述文件中的说明,我启动服务器:

$ cd vanilla
$ mvn package
$ java -jar target/*.jar

但是,当我运行时

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

我明白了

Could not resolve host: access_token curl: (6) Could not resolve host: b561ff06-4259-466e-92d8-781db1a51901,

最佳答案

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

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

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

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

关于java - 示例 Spring OAuth2.0 服务器的curl 出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46835667/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com