I have to Authorize a request using OAuth1.0
.
In the response header it requires access token,OAuth Nonce,Timestamp and OAuthSignature.I wrote methods for creating Timestamp
and OAuthNonce
How the OAuthsignature is generated using these parameters?It uses HMAC-SHA1 method for Hashing the signature.
How can i create a method for generating an OAuth signture key. Can anyone suggest a method foe creating the signature using these parameters? Thanks in Advance.
private static string CreateOAuthTimestamp()
{
var nowUtc = DateTime.UtcNow;
var timeSpan = nowUtc - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
var timestamp = Convert.ToInt64(timeSpan.TotalSeconds).ToString();
return timestamp;
}
private string CreateOauthNonce()
{
return Convert.ToBase64String(new ASCIIEncoding().GetBytes(DateTime.Now.Ticks.ToString()));
}