title: OAuth Twitter iOS Swift
body: <p>I am building an application with Swift-iOS and deployd as backend Deployd. I'm trying to figure out Twitter OAuth. Basically I would want to know how can I send my server a token and let dpd-passport save it in a user collection.</p>
  
  <p>Twitter API is returning access token very fine. Here's my code:</p>
  
  <pre><code>    TwitterClient.SharedInstance.requestSerializer.removeAccessToken()
      //where TwitterClient is a BDBOAuth1SessionManager instance
      TwitterClient.SharedInstance.fetchRequestTokenWithPath("oauth/request_token", method: "GET", callbackURL: NSURL(string: "cptwitter://oauth"), scope: nil, success: { (requestToken: BDBOAuth1Credential!) -&gt; Void in
      print(requestToken.token)
      let authURL = NSURL(string: "https://api.twitter.com/oauth/authorize?oauth_token=\(requestToken.token)")
      UIApplication.sharedApplication().openURL(authURL!)
  
      }) { (error: NSError!) -&gt; Void in
          print("failed to  get the token request")
  }
  </code></pre>