简体   繁体   English

如何在swift 3中生成OAuth1 HMAC SHA1签名

[英]How to generate OAuth1 HMAC SHA1 signature in swift 3

I'm working on a small swift program to work with Yelp API over OAuth-1. 我正在开发一个小型的swift程序,用于在OAuth-1上使用Yelp API。 I am looking to generate a HMAC-SHA1 signature. 我期待生成HMAC-SHA1签名。

I have the customer key, secret key , token and token secret. 我有客户密钥,密钥,令牌和令牌密钥。

From what I know, to make an API request with OAuth1 , we need the following attributes : 据我所知,要使用OAuth1发出API请求,我们需要以下属性:

  1. 1.oauth_consumer_key 1.oauth_consumer_key
  2. oauth_token 组oauth_token
  3. oauth_signature_method = (HMAC-SHA1) oauth_signature_method =(HMAC-SHA1)
  4. oauth_signature oauth_signature
  5. oauth_timestamp oauth_timestamp
  6. oauth_nonce oauth_nonce

I have the first 1,2,3 parts but I don't know how do I generate #4,5,6 I am kind of new to ios/swift3 so please point me into right direction 我有前1,2,3部分,但我不知道如何生成#4,5,6我是ios / swift3的新手,所以请指出我正确的方向

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM