我有一个iPad应用程序,需要将vimeo集成到它。我正处于将其集成到我的应用程序的初始阶段。我首先需要通过vimeo来验证我的应用程序。vimeo o通过iPhone应用程序进行身份验证
我已经通过了步骤在documenattion认证,我能够穿过第一2步:
请求令牌: http://vimeo.com/oauth/request_token
用户授权: http://vimeo.com/oauth/authorize
但无法通过最后一步获得oauth_token和oauth_token_secret:
接入令牌: http://vimeo.com/oauth/access_token
Vimeo重定向到回调url,而不是回到应用程序,这是罚款,直到我得到验证和授权令牌。但是,一旦我使用这些获得的oauth_token和oauth_token_secret,控制台显示以下错误信息:
错误域= NSURLErrorDomain代码= -1012“的操作无法完成(NSURLErrorDomain错误-1012)”的UserInfo = 0x18146180 { NSErrorFailingURLKey = http://vimeo.com/oauth/access_token?oauth_token=141b4ff56c48dc5d03501297bde85ebc&oauth_verifier=land-1886924229,NSErrorFailingURLStringKey = http://vimeo.com/oauth/access_token?oauth_token=141b4ff56c48dc5d03501297bde85ebc&oauth_verifier=land-1886924229,NSUnderlyingError = 0x181483d0 “操作无法完成。(kCFErrorDomainCFNetwork错误-1012。)”}
任何人都可以请帮助或至少提供一些方向?
为了深入了解,我使用了OAuthConsumer框架。下面是我们将请求获得访问令牌的代码行:
(无效)successfulAuthorizationWithToken:(的NSString *)标记验证:(的NSString *)验证{ 的NSLog(@ “successfulAuthorizationWithToken”); OAMutableURLRequest *请求; OADataFetcher * fetcher;
// NSURL * url = [NSURL URLWithString:@“https://api.twitter.com/oauth/access_token”]; NSURL * url = [NSURL URLWithString:@“http://vimeo.com/oauth/access_token”]; request = [[[[OAMutableURLRequest alloc] initWithURL:url consumer:self.consumer token:self。accessToken realm:nil signatureProvider:nil autorelease];
OARequestParameter * p0 = [[OARequestParameter alloc] initWithName:@“oauth_token” value:token]; OARequestParameter * p1 = [[OARequestParameter alloc] initWithName:@“oauth_verifier” value:verifier]; NSArray * params = [NSArray arrayWithObjects:p0,p1,nil]; [请求setParameters:params];
fetcher = [[[[[[OADataFetcher alloc] init] autorelease];
[提取器fetchDataWithRequest:请求 委托:自 didFinishSelector:@selector(accessTokenTicket:didFinishWithData :) didFailSelector:@selector(accessTokenTicket:didFailWithError :)];
[p0 release]; [p1 release];下面链接中指定
}
我也试着解决方案: Twitter API + OAuthConsumer.framework
它说,使用[[[OAHMAC_SHA1SignatureProvider页头] INIT]自动释放]作为signatureProvider。但结果是一样的。
我需要后,我得到验证,并使用访问令牌一步授权令牌以下值: 的oauth_token = YourAuthorizedOauthToken & oauth_token_secret = YourAuthorizedTokenSecret
嗨,我有同样的问题。你是如何解决它的? – Janub 2012-07-05 15:36:22