3

I am making a simple REST web application in asp.net. I am making calls to server with restsharp. Now I am struggling to get this application using oauth authentification, and I am getting error on get_request_token which state oauth_problem=signature invalid.

Here are the links I am calling:

const string baseUrl = "https://api.login.yahoo.com/";
    const string client_id = "dj0yJmk9bEw1Nm9KamhHdENQJmQ9WVdrOVRUTkVhbkJhTjJjbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1mZA--";
    const string client_secret = "b744521d132b295602d1325fa3cf680ff2ef489d";
    const string urlparamsOauth = "oauth2/request_auth?client_id=" + client_id + "&redirect_uri=oob&response_type=code&language=en-us";
    const string urlToken = "/oauth/v2/get_request_token?oauth_nonce=147423229375&oauth_timestamp=1474229375&oauth_consumer_key=" + client_id +
        "&oauth_signature_method=plaintext&oauth_signature=" + client_secret + 
        "&oauth_version=1.0&xoauth_lang_pref=en-us&oauth_callback=http://localhost/home/index";

And like this I am making requests:

var client = new RestClient(baseUrl);
        var req = new RestRequest(urlparamsOauth, Method.GET);
        IRestResponse resp = client.Execute(req);
        var json1 = resp.Content;
        var req1 = new RestRequest(urlToken, Method.GET);
        IRestResponse resp1 = client.Execute(req1);
        var json = resp1.Content;

Maybe I am not doing it on a good way. Please Help, and thank you in front!

dhrubo_moy
  • 1,144
  • 13
  • 31

0 Answers0