title: vimeo oAth authentication through iPhone app
body: <p>I have an iPad app and need to integrate vimeo to it. I'm in the initial stages of integrating it to my app. I first need to authenticate my app through vimeo.</p>
  
  <p>I've gone through the steps for authentication in documentation and I'm able to pass through first 2 steps:</p>
  
  <p>Request Token:
      <a href="http://vimeo.com/oauth/request_token" rel="nofollow noreferrer">http://vimeo.com/oauth/request_token</a></p>
  
  <p>User Authorization:
      <a href="http://vimeo.com/oauth/authorize" rel="nofollow noreferrer">http://vimeo.com/oauth/authorize</a></p>
  
  <p>But unable to get <code>oauth_token</code> and <code>oauth_token_secret</code> through last step:</p>
  
  <p>Access Token:
      <a href="http://vimeo.com/oauth/access_token" rel="nofollow noreferrer">http://vimeo.com/oauth/access_token</a></p>
  
  <p>Vimeo redirects to callback url instead of going back to the app which is fine until I get verifier and authorization token. But once I use these to get <code>oauth_token</code> and <code>oauth_token_secret</code>, console shows following error message:</p>
  
  <pre><code>Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. 
  (NSURLErrorDomain error -1012.)" UserInfo=0x18146180 {
      NSErrorFailingURLKey=http://vimeo.com/oauth/access_token?oauth_token=141b4ff56c48dc5d03501297bde85ebc&amp;oauth_verifier=land-1886924229, 
      NSErrorFailingURLStringKey=http://vimeo.com/oauth/access_token?oauth_token=141b4ff56c48dc5d03501297bde85ebc&amp;oauth_verifier=land-1886924229, 
      NSUnderlyingError=0x181483d0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"
  }
  </code></pre>
  
  <p>Can anyone please help or atleast provide some directions?</p>
  
  <p>To further give an insight, I'm using <code>OAuthConsumer</code> framework. Below are the lines of code where we place request to get an access token:</p>
  
  <pre><code>- (void)successfulAuthorizationWithToken:(NSString *)token verifier:(NSString *)verifier  {
      NSLog(@"successfulAuthorizationWithToken");
      OAMutableURLRequest *request;
      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];
      [request setParameters:params];
  
      fetcher = [[[OADataFetcher alloc] init] autorelease];
  
      [fetcher fetchDataWithRequest:request
                           delegate:self
                  didFinishSelector:@selector(accessTokenTicket:didFinishWithData:)
                    didFailSelector:@selector(accessTokenTicket:didFailWithError:)];
  
      [p0 release];
      [p1 release];
  
  }
  </code></pre>
  
  <p>I've also tried solutions specified in below link:
  <a href="https://stackoverflow.com/questions/3221083/twitter-api-oauthconsumer-framework">Twitter API + OAuthConsumer.framework</a></p>
  
  <p>It says to use <code>[[[OAHMAC_SHA1SignatureProvider alloc] init] autorelease]</code> as <code>signatureProvider</code>. But the results are same.</p>
  
  <p>I need to get following values after I get verifier and authorized token using the access token step:
  <code>oauth_token=YourAuthorizedOauthToken&amp;oauth_token_secret=YourAuthorizedTokenSecret</code></p>