问题标签 [oauth-1.0a]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
334 浏览

twitter - 使用 Twitter api url 发推文

LinkedIn api提供访问令牌以在 url 中使用它来发布oauth2Rest client. 因此,通过url在我的应用程序中使用,我可以发布消息。

Twitter api用于oauth1通过接受来发推文parameter。但问题是timestamp,nounce,oauth_signature parameters自动生成并为 .Here 中的每个请求不断变化。这里的Rest clienturl 不足以发推文,它需要参数,但 3 个参数在 Rest 客户端上不断变化。

我试图传递 url 中的每个参数,它抛出

我只依赖 url 来发送推文。我的应用程序也支持参数,但三个参数是自动生成的。我无法自动生成 bcz,我在我的应用程序中对其进行了硬编码。

有没有使用 url 发推文的解决方案?

有什么办法可以固定这三个参数吗?

0 投票
1 回答
153 浏览

php - 7 数字API无效签名

请你帮帮我。我正在尝试为 7 Digital 的高级 API 生成 HMAC-SHA1 哈希,但是我无法获得正确的签名。我关注了这篇文章https://oauth1.wp-api.org/docs/basics/Signing.html并得到了以下代码:

请注意,我还尝试使用 base64_encode 对签名进行编码不起作用,并且还尝试像这样对密钥进行 urlencode:

我也使用过那里的参考页面。

以上输出:

https://api.7digital.com/1.2/oauth/requesttoken?oauth_consumer_key=KEY&oauth_nonce=495776478&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1477934267&oauth_version=1.0&oauth_signature=fe3a5c61618d2a144b6083b57fc

非常感谢您的帮助,在此先感谢您!!

0 投票
0 回答
1333 浏览

swift3 - 使用 Alamofire 进行 OAuth1.0 身份验证

我在 swift3.0 项目中使用 alamofire 进行联网。我需要从 woocommerce rest api 获取数据,例如http://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties 下面是我在项目中添加的代码。我认为存在身份验证问题。

回复:

0 投票
1 回答
2069 浏览

c# - 在 C# 中使用 Oauth1 从 REST API 获取请求令牌

正如标题所述,我只需要 OAuth1.0 身份验证的第一部分的帮助:获取请求令牌。我在使用 C# 的控制台应用程序中执行此操作。我已经为此工作了 3 天,并且尝试了许多来自互联网的示例,但到目前为止没有任何效果。这是我目前的尝试:

这在使用未经身份验证的 API 时效果很好(例如http://rest-service.guides.spring.io/greeting),但是在像这样运行它时会收到 401 Forbidden 。我错过了什么?顺便说一句,我是 API 的新手。

0 投票
2 回答
2970 浏览

http - 将 woocommerce rest api v1 与 http 和 javascript(不是 https)一起使用

我使用oauth-signature生成我的 oauth-signature 以连接 woocommerce api。我遵循了woocommerce rest api 文档中所述的所有步骤:

必需的参数是:oauth_consumer_key、oauth_timestamp、oauth_nonce、oauth_signature 和 oauth_signature_method。oauth_version 不是必需的,应该省略。OAuth 随机数可以是任何随机生成的 32 个字符(推荐)的字符串,该字符串对使用者密钥是唯一的。ETC...

但是以下请求仍然返回未经授权的:

http://siglar.no/wp-json/wc/v1/orders?oauth_consumer_key=ck_1ca1c6ff1a93de4836ee52c766538043d7f15d07&oauth_timestamp=1482431903&oauth_nonce=P5SM1FGeFVpdRyHWp4HHYOMlYAhxE6Gl&oauth_signature=cEETZUnSNQD6uorII9c%2B5SXf0M8%3D&oauth_signature_method=HMAC-SHA1

(别担心,钥匙仅供本地使用)

回复:

我正在使用 WP 4.7、WC 2.6.9、为 WC 激活的 API、为 WC 禁用 SSL 等。

我还检查了这是按照图书馆的要求完成的:

使用签名基本字符串和带有 & 字符的消费者密钥和 HMAC-SHA1 散列算法生成签名。

时区为 UNIX,应根据需要生成随机数。那么你们中的一些人发现问题了吗?这是我的代码:

其他人对此有任何运气吗?

0 投票
1 回答
2067 浏览

android - Android:在 Volley 请求中生成 Oauth1 签名

我正在尝试使用 volley 在我的 android 应用程序中添加 Oauth1 授权

在邮递员中,当我添加 oauth_consumer_key、oauth_consumer_secret、token_key token_secret 等详细信息时,如下图所示

在 Postman 中添加授权详细信息

它会生成如下图所示的标题并成功收到响应。

邮递员生成的标头

邮递员生成的标头

问题

我搜索了很多以创建 oauth 签名,例如创建 postmasn 以附加 volley ServerConnectionChannel 但失败了。oauth_signature="A1QPwTATVF4x3cN0%2FN46CZrtSKw%3D"

当前代码

此代码创建一个签名,如 :oauth_signature="42a611860e29e893a435b555e7a9559a704f4e94" 并且未能获得授权。

收到类似错误:BasicNetwork.performRequest: url 的意外响应代码 401

?如何生成像邮递员一样使用 volley 提供的 oauth_signature

?我们如何在 volley 中添加 oauth1 签名..

请帮忙..谢谢

0 投票
1 回答
1337 浏览

java - 无法为我的 IMS LTI 请求生成 oauth_signature

在 IMS Emulator ( http://ltiapps.net/test/tc.php ) 中单击“保存数据”,使用自动填充的数据生成 outh_signature 并将其作为隐藏值放入窗体 frmLaunch(name='frmLaunch ') 形式。我需要以编程方式生成类似的 outh_signature,但即使我使用相同的 oauth_nounce 和 oauth_timestamp,我也无法生成模拟器生成的确切 oauth_signature。我不确定生成时需要发送的请求正文是什么签名..

要重新创建场景,请按照以下步骤操作

  1. 点击网址http://ltiapps.net/test/tc.php
  2. 单击清除数据,然后在弹出窗口中单击确定
  3. 选择角色作为学习者,然后单击保存数据
  4. 保存数据后,您将看到一个 outh_signature 隐藏值,输入 id 为“oauth_signature”

    我尝试以以下方式生成,但无法获得预期的签名。

    pom.xml

    我通过发送如下请求正文尝试了上述程序,并获得了 oauth 签名为 0YI3mBg7gmnWaz8YyISG4IoHVQ4=但预期是yuuvR1pVDm5xWOYhMtBcBBVTdf8=

版本=LTI-1p0&reset=&endpoint=http://ltiapps.net/test/tp.php®ister=http://ltiapps.net/test/tp.php&key=jisc.ac.uk&secret=secret<i_message_type=basic-lti-launch-request&message_type=&tool=<i_version=LTI- 1p0&launch_presentation_locale=&launch_presentation_document_target=&launch_presentation_width=&launch_presentation_height=&launch_presentation_css_url=&launch_presentation_return_url=&custom=&ext=&signaturemethod=HMAC-SHA1&accept_media_types=&accept_presentation_document_targets=embed,frame,iframe,window,popup,overlay,none&content_item_return_url=http://ltiapps.net/test/tc- content.php&accept_unsigned=&accept_multiple=&accept_copy_advice=&auto_create=&title=&text=&data=&tool_consumer_instance_guid=&tool_consumer_instance_name=&tool_consumer_instance_description=&tool_consumer_instance_url=&tool_consumer_instance_contact_email=&tool_consumer_info_product_family_code=&tool_consumer_info_version=&context_id=&context_type=&a_context_type=&context_title=&context_label=&lis_course_offering_sourcedid=&lis_course_section_sourcedid=&resource_link_id=429785226&resource_link_title=&resource_link_description=&user_id=&lis_person_name_given=&lis_person_name_family=&lis_person_name_full=&lis_person_contact_email_primary=&lis_person_sourcedid=&roles=Learner&a_role=&user_image=&mentors= &username=&lis_outcome_service_url=&lis_result_sourcedid=&ext_ims_lis_basic_outcome_url=&ext_ims_lis_resultvalue_sourcedids=&ext_ims_lis_memberships_url=&ext_ims_lis_memberships_id=&ext_ims_lti_tool_setting_url=&ext_ims_lti_tool_setting_id=&setting=&custom_tc_profile_url=&custom_system_setting_url=&custom_context_setting_url=&custom_link_setting_url=&custom_lineitems_url=&custom_results_url=&custom_lineitem_url=&custom_result_url=&custom_context_memberships_url=&custom_link_memberships_url=&custom_caliper_federated_session_id=&custom_caliper_eventstore_url=&custom_caliper_api_key=custom_link_memberships_url=&custom_caliper_federated_session_id=&custom_caliper_eventstore_url=&custom_caliper_api_key=custom_link_memberships_url=&custom_caliper_federated_session_id=&custom_caliper_eventstore_url=&custom_caliper_api_key=

你能告诉我我哪里出错了..

0 投票
0 回答
175 浏览

php - phpoauthLib Etsy 在非对象上登录 getAbsoluteUri()

我一直在尝试为 Etsy 设置 OAuth 以在项目中使用,但甚至无法使用 PhpoAuthLib 加载登录页面。很可能我对使用 Oauth 的知识水平很低。

目前这是我的登录页面,几乎与开发人员给出的示例相同。

运行页面时出现致命错误

我已经进入了 bootstrap.php 并在最后回应了一个运行良好的声明,所以似乎没有在那里出错。错误与

不确定是否重要,但登录页面位于 mywebsite/folder/folder/etsylogin.php .. 这有什么不同吗?

0 投票
0 回答
156 浏览

ios - 无效的签名。预期的签名基本字符串 - OAuth1.0 Yelp API

我在我的应用程序中使用 yelp V2 API。在任何特定区域请求餐厅和食物详细信息时,我都收到以下响应。我尝试了几乎所有堆栈溢出的解决方案以及我得到的其他任何地方。但仍然没有进展。任何人都可以帮助我吗?

错误 :

{“error”:{“text”:“签名无效”,“id”:“INVALID_SIGNATURE”,“description”:“无效签名。预期的签名基字符串:“GET..”}

0 投票
1 回答
916 浏览

ios - OAuthSwift (1) 连接

我正在尝试创建一个客户端(在私有 pod 中)以连接到 garmin API(OAuth1),但我遇到了一些问题。我正在使用 OAuthSwift 和 OAuthSwiftAlamofire

首先,我试图获得所有授权,

应用代理

因此,这部分代码在 safari 中打开了 garmin 的连接页面,我使用我的帐户 mail/pwd 进行连接,仅此而已。回调永远不会成功,或者永远不会失败。所以我无法访问我的凭据。这就像 authorize(withCallBackURL...) 不要等待 callBack 并且永远不会获取 URL 中的信息(如 oauth-identifier )。

我不明白为什么,如果你有一个想法谢谢。