【发布时间】:2013-12-12 17:11:01
【问题描述】:
我已经使用 GitHub API3 成功地将 github 集成到我的 ios App 中。
但我的问题是我无法删除/撤销访问令牌。
我尝试了以下代码
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";
提前致谢
【问题讨论】:
-
要撤销您自己的令牌,您需要使用基本身份验证:developer.github.com/v3/oauth/#oauth-authorizations-api 进行身份验证。要删除其他用户的 OAuth 令牌,您需要使用不同的端点:developer.github.com/v3/oauth/…。
-
@IvanZuzak 你知道怎么做吗? . .我尝试使用基本身份验证但无法获得它。
标签: ios objective-c oauth access-token github-api