我正在为Instagram编写C#客户端。我已经注册了我的申请并填写了以下字段:申请名称,说明,网站,OAuth redirect_uri。但是我在C#客户端收到此错误消息:
此客户端未启用xAuth。
我认为问题出在网站,OAuth redirect_uri字段中。我必须在这些领域中加入什么价值?
这是必须获取access_token的方法(来自xNet库的HttpRequest类):
private string GetAccessToken()
{
using (var request = new HttpRequest())
{
var urlParams = new RequestParams();
urlParams["client_id"] = "ce3c76b914cb4417b3721406d7fe3456";
urlParams["client_secret"] = "b8ad0c21ce8142d0a8c0fa2d2bd78f53";
urlParams["username"] = this.login;
urlParams["password"] = this.password;
urlParams["grant_type"] = "password";
urlParams["scope"] = "comments likes relationships";
try
{
this.json = request.Post("https://api.instagram.com/oauth/access_token", urlParams).ToString();
var values = JsonConvert.DeserializeObject<InstagramResponse>(this.json);
return values.access_token;
}
catch (Exception)
{
return null;
}
}
}