1

我正在使用 LinkedIn Hammock ,回调后它给出错误 oauth_problem=parameter_absent&oauth_parameters_absent=oauth_verifier

OAuthCredentials credentials = new OAuthCredentials();
        credentials.ConsumerKey = "Consumer key";
        credentials.ConsumerSecret = "Consumer secret";
                credentials.Token = token1;
        credentials.TokenSecret = tokenS;
        string Verifier = Request.QueryString["oauth_verifier"].ToString();
        credentials.Verifier = Verifier
 credentials.Type = OAuthType.AccessToken;
        credentials.ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader;
        credentials.SignatureMethod = OAuthSignatureMethod.HmacSha1;
        credentials.Version = "1.0";


    RestClient client = new RestClient();

    client.Authority = "https://api.linkedin.com/uas/oauth";
    client.Credentials = credentials;
    client.Method = WebMethod.Post;

    RestRequest request = new RestRequest();
    request.Path = "accessToken";

    RestResponse response = client.Request(request);

    string content = response.Content;

    Response.Write(content);
4

1 回答 1

0

尝试 request.Path = "/accessToken" 而不是 request.Path = "accessToken" (不带斜线)

于 2011-07-19T12:56:29.563 回答