gpt4 book ai didi

java - 在 Oauth 进程中从 JIRA 获取请求 token 时出错

转载 作者:行者123 更新时间:2023-11-30 08:50:04 26 4
gpt4 key购买 nike

我正在关注 this设置 Oauth。

我已经设置了公钥,下载了jar:

   rest-oauth-client-1.0.one-jar.jar
rest-oauth-client-1.0-sources.jar

页面上提到,但是在尝试执行时:

   java -jar rest-oauth-client-1.0.one-jar.jar requestToken https://mycompanyname.atlassian.net

我收到一个奇怪的错误。我已经设置了消费者 key 。错误是:

    Jul 01, 2015 3:38:26 PM org.apache.http.impl.client.DefaultRequestDirector handleResponse

WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm="https%3A%2F%2Fmycompanyname.atlassian.net", oauth_problem="consumer_key_unknown"}

Exception in thread "main" java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at com.simontuffs.onejar.Boot.run(Boot.java:340)

at com.simontuffs.onejar.Boot.main(Boot.java:166)

Caused by: java.lang.RuntimeException: Failed to obtain request token

at com.atlassian.oauth.client.example.AtlassianOAuthClient.getRequestToken(AtlassianOAuthClient.java:66)

at com.atlassian.oauth.client.example.JIRAOAuthClient.main(JIRAOAuthClient.java:52)

... 6 more

Caused by: net.oauth.OAuthProblemException: consumer_key_unknown

at net.oauth.client.OAuthResponseMessage.toOAuthProblemException(OAuthResponseMessage.java:83)

at net.oauth.client.OAuthClient.invoke(OAuthClient.java:306)

at net.oauth.client.OAuthClient.invoke(OAuthClient.java:260)

at net.oauth.client.OAuthClient.getRequestTokenResponse(OAuthClient.java:190)

at com.atlassian.oauth.client.example.AtlassianOAuthClient.getRequestToken(AtlassianOAuthClient.java:57)

... 7 more

谁能帮我解决这个错误..请不要建议我 this关联。我去过这个文档几次。我一直在尝试用 python 做同样的事情,但我不知道如何获取消费者 secret 。

最佳答案

如果您尝试使用 jar rest-oauth-client-1.0.one-jar.jar 获取 token ,您的消费者 key 必须是“hardcoded-consumer”。

谢谢!

关于java - 在 Oauth 进程中从 JIRA 获取请求 token 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31159701/

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