0

So I have this header for my authorization:

 string oAuthHeader = string.Format("OAuth oath_consumer_key=\"{0}\",oath_signature_method=\"{1}\",oath_timestamp=\"{3}\",oath_nonce=\"{4}\",oath_version=\"{5}\",oath_signature=\"{2}\"", _consumerKey, OAuthSignatureMethod.HmacSha1, GenerateSignature(), GenerateTimeStamp(), GenerateNonce(), Version);

Which gets added here:

request.AddHeader("Authorization", oAuthHeader);

Been seeing a few demos on this, but they all include the token. In this case, there is no token, just key and secret. How would I go about generating the hmacsha1 signature?

ggiaquin16
  • 165
  • 1
  • 15
  • Does https://stackoverflow.com/questions/30706133/create-oauth-signature-with-hmac-sha1-encryption-returns-http-401 help? – mjwills Aug 03 '18 at 22:44
  • @mjwills I've been looking at that plus a few other questions to see if I can extract anything from other people's questions. My problem is that I lack very little knowledge on this subject, so while maybe that sample might be helpful, I wouldn't know how to modify it for my needs. – ggiaquin16 Aug 03 '18 at 22:55
  • 1
    OAuth is a "dance". [These samples should be helpful](https://github.com/restsharp/RestSharp/blob/master/RestSharp.IntegrationTests/oAuth1Tests.cs). You'll see the "token dance" [starting here](https://github.com/restsharp/RestSharp/blob/master/RestSharp.IntegrationTests/oAuth1Tests.cs#L56) in the Twitter sample. Hth.. – EdSF Aug 03 '18 at 23:36
  • 1
    Is it not more often referred to as a "handshake"? – Thymine Aug 04 '18 at 00:08
  • Nice one @Thymine :) Yup..but dancing is more fun :) – EdSF Aug 04 '18 at 17:19

0 Answers0