I'm trying to consume OpenTable's API.
They use OAuth 1.0a 2 Legged authorization. From what I've seen in the source the OAuth1Authenticator.ForProtectedResource method was the one to use in order to achieve this, but not matter what I try, I cannot get passed the Invalid Consumer Signature error response from open table.
Here is a slimmed down version of the code, just for testing purposes:
var client = new RestClient();
client.BaseUrl = "<URL HERE>";
client.Authenticator = OAuth1Authenticator.ForProtectedResource("<CONSUMER KEY>", "<CONSUMER SECRET>", string.Empty, string.Empty);
var request = new RestRequest();
request.Resource = "restaurant/";
request.RootElement = "RestaurantDetailsResults";
request.AddParameter("pid", "1111", ParameterType.QueryString);
request.AddParameter("rid", "2222", ParameterType.QueryString);
request.AddParameter("st", "0", ParameterType.QueryString);
request.AddParameter("offersearchmode", "1", ParameterType.QueryString);
IRestResponse response = client.Execute(request);
Is there a way to view the exact Authentication header that RestSharp generates based on the above? Has anyone else successfully consumed a rest api with OAuth1 2-legged auth?
Thanks in advance.