基于 Swift 的 OAuth 的 iOS 库:OAuthSwift

jopen 9年前

OAuthSwift 是基于 Swift 的 OAuth 的 iOS 库,支持 OAuth 1 和 OAuth 2。

OAuth 页面

推ter
Flickr
Github
Instagram
Foursquare
Fitbit
Withings

示例

// OAuth1.0  let oauthswift = OAuth1Swift(      consumerKey:    "********",      consumerSecret: "********",      requestTokenUrl: "https://api.推ter.com/oauth/request_token",      authorizeUrl:    "https://api.推ter.com/oauth/authorize",      accessTokenUrl:  "https://api.推ter.com/oauth/access_token"  )  oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/推ter"), success: {      credential, response in      println(credential.oauth_token)      println(credential.oauth_token_secret)  }, failure: failureHandler)    // OAuth2.0  let oauthswift = OAuth2Swift(      consumerKey:    "********",      consumerSecret: "********",      authorizeUrl:   "https://api.instagram.com/oauth/authorize",      responseType:   "token"  )  oauthswift.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/instagram"), scope: "likes+comments", state:"INSTAGRAM", success: {      credential, response in      println(credential.oauth_token)  }, failure: failureHandler)

Setting Swift Compiler

基于 Swift 的 OAuth 的 iOS 库:OAuthSwift

Setting URL Schemes

基于 Swift 的 OAuth 的 iOS 库:OAuthSwift

Images

基于 Swift 的 OAuth 的 iOS 库:OAuthSwift基于 Swift 的 OAuth 的 iOS 库:OAuthSwift基于 Swift 的 OAuth 的 iOS 库:OAuthSwift

 

项目主页:http://www.open-open.com/lib/view/home/1416041629789