1
我已经通过使用GitHub API3成功地将github集成到了我的ios应用程序中。GitHub API撤销访问令牌
但我的问题是我无法删除/撤销访问令牌。
我尝试下面的代码
NSString * querystr= @"https://api.github.com/authorizations";
// i tried this url url also https://api.github.com/authorizations?client_id=1234yyrhrh
NSMutableURLRequest *request2 = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:querystr]];
[NSURLConnection sendAsynchronousRequest:request2 queue:theQ
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
{
NSArray * array = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@",array);
}];
我没有得到任何错误,但阵列打印以下消息
"documentation_url" = "http://developer.github.com/v3";
message = "Not Found";
在此先感谢
要吊销自己的令牌,则需要使用基本身份验证来验证:http://developer.github.com/v3/oauth/#oauth-authorizations-api。要删除其他用户的OAuth令牌,您需要使用不同的端点:http://developer.github.com/v3/oauth/#revoke-an-authorization-for-an-application。 –
@IvanZuzak你有什么想法如何做。 。 。我尝试但无法使用基本身份验证获得它。 –