简体   繁体   中英

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. I am looking to generate a HMAC-SHA1 signature.

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 :

  1. 1.oauth_consumer_key
  2. oauth_token
  3. oauth_signature_method = (HMAC-SHA1)
  4. oauth_signature
  5. oauth_timestamp
  6. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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