Swift-iOS でアプリケーションを構築し、バックエンド Deployed としてデプロイしています。Twitter OAuth を理解しようとしています。基本的に、サーバーにトークンを送信し、dpd-passport でそれをユーザー コレクションに保存する方法を知りたいと思います。
Twitter API はアクセス トークンを非常に適切に返します。これが私のコードです:
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!) -> 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!) -> Void in
print("failed to get the token request")
}