如何使用 oauth1.0a对于 blueconic进行 API 调用?

问题描述

我有应用程序的消费者密钥和消费者秘密,现在我必须进行 api 调用。 我没有找到 Blueconic 应用程序的任何授权/身份验证链接。 他们的身份验证机制仅支持 oauth1.0。

https://support.blueconic.com/hc/en-us/articles/202528082-BlueConic-REST-API#oauth-signed-requests

Java 中给出的示例,如下所示。

private static final String CONSUMERKEY = "";
private static final String CONSUMERSECRET = "";
private static final String ENCODING = "UTF-8";

public static void main(String[] args) throws OAuthMessageSignerException,OAuthExpectationFailedException,OAuthCommunicationException,ClientProtocolException,IOException {
    HttpClient httpClient = new DefaultHttpClient();
    HttpGet request = new HttpGet("https://lovesac.sb.blueconic.net/rest/profileProperties");
    OAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMERKEY,CONSUMERSECRET);
    consumer.sign(request);
    HttpResponse response = httpClient.execute(request);

    System.out.println("Response code: " + response.getStatusLine().getStatusCode());
 //   String content = new String(IoUtils.toByteArray(response.getEntity().getContent()),ENCODING);
    System.out.println("Response content: " );
}

现在我想在 golang 中做同样的事情。 我想知道上面提到的 oauth1.0a 路标是否有任何库/示例代码。^

仅供参考,我已经将这些库扔到了 golang 中。 https://github.com/mrjones/oauthrequires: RequestTokenUrl,AccesstokenUrl,AuthorizetokenUrl and callback url.

http://godoc.org/github.com/nhjk/oauthrequires: a tokenKey and tokenSecret as well as the consumerKey and consumerSecret.

如果我可以使用上面的库之一,有人可以提供代码片段示例吗?我尝试的任何操作都会返回未经授权的响应。

或者您可以帮助我了解 blueconic 的 api 身份验证流程。我如何使用 Postman/oauth 调用 api(示例应该在 golang 中)

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...