{"id":28367232,"url":"https://github.com/oauthswift/oauthswiftfutures","last_synced_at":"2026-03-27T04:31:46.373Z","repository":{"id":62449209,"uuid":"48258735","full_name":"OAuthSwift/OAuthSwiftFutures","owner":"OAuthSwift","description":"Use Future with OAuthSwift","archived":false,"fork":false,"pushed_at":"2018-08-16T12:28:44.000Z","size":20,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-05T04:28:39.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OAuthSwift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-18T22:10:50.000Z","updated_at":"2024-02-06T20:25:00.000Z","dependencies_parsed_at":"2022-11-29T13:20:56.395Z","dependency_job_id":null,"html_url":"https://github.com/OAuthSwift/OAuthSwiftFutures","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/OAuthSwift/OAuthSwiftFutures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OAuthSwift%2FOAuthSwiftFutures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OAuthSwift%2FOAuthSwiftFutures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OAuthSwift%2FOAuthSwiftFutures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OAuthSwift%2FOAuthSwiftFutures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OAuthSwift","download_url":"https://codeload.github.com/OAuthSwift/OAuthSwiftFutures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OAuthSwift%2FOAuthSwiftFutures/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261042949,"owners_count":23101778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-29T01:09:04.155Z","updated_at":"2026-03-27T04:31:46.365Z","avatar_url":"https://github.com/OAuthSwift.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuthSwiftFutures\n\n\u003cimg align=\"left\" src=\"https://raw.githubusercontent.com/OAuthSwift/OAuthSwift/master/Assets/OAuthSwift-icon.png\" alt=\"OAuthSwiftFutures\" hspace=\"20\" /\u003e\nOAuthSwiftFutures bring you [futures/promises](https://en.wikipedia.org/wiki/Futures_and_promises) to OAuthSwift.\n\nIt's build on top [BrightFutures](https://github.com/Thomvis/BrightFutures) to achieve great asynchronous code.\n\n\u003cbr\u003e\u003cbr\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\n## Installation\n\n### Support CocoaPods\n\n* Podfile\n\n```ruby\nuse_frameworks!\n\npod 'OAuthSwiftFutures', '~\u003e 1.0.0'\n```\n\n### Support Carthage\n\n* Install Carthage (https://github.com/Carthage/Carthage)\n* Create Cartfile file\n```\ngithub \"OAuthSwift/OAuthSwiftFutures\" ~\u003e 1.0.0\n```\n* Run `carthage update`.\n* On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop OAuthSwift.framework and the dependencies from the Carthage/Build/\"OSNAME\" folder on disk.\n\n## How to use\n\n### OAuth1.0\n\n```swift\nlet (authorize, handle) = oauthswift.authorizeFuture(withCallbackURL: \"oauth-swift://oauth-callback/twitter\")\nauthorize.onSuccess { credential, response, parameters in\n  print(credential.oauth_token)\n  print(credential.oauth_token_secret)\n  print(parameters[\"user_id\"])\n}\nauthorizeFuture.onFailure { error in\n  print(error.localizedDescription)\n}\n```\n### OAuth2.0\n\n```swift\nlet (authorize, handle) = oauthswift.authorizeFuture(withCallbackURL: \"oauth-swift://oauth-callback/facebook\",\n    scope: \"likes+comments\", state:\"generatedone\")\nauthorize.onSuccess { credential, response, parameters in\n  print(credential.oauth_token)\n}\nauthorize.onFailure { error in\n  print(\"\\(error)\")\n}\n```\n\n### Request\n\nUse one the client new functions\n```swift\nlet (authorize, handle) = oauthswift.client.getFuture(\"https://api.linkedin.com/v1/people/~\")\nauthorize.onSuccess { data, response in\n  let dataString = String(data: data, encoding: String.Encoding.utf8)\n  print(dataString)\n}\nauthorize.onFailure { error in\n  print(\"\\(error)\")\n}\n```\n\n### Playing with Future\n\n```swift\n// after created\nlet requestFuture = authorize.flatMap { tuple -\u003e Future\u003c(data: Data, response: HTTPURLResponse), OAuthSwiftError\u003e in\n    // will be executed only if authorization succeed\n    let (future, _) = oauthswift.client.getFuture(\"https://api.linkedin.com/v1/people/~\")\n    return future\n}\nrequestFuture.onSuccess { data, response in\n  print(data)\n}\n```\nYou can learn more at [BrightFutures](https://github.com/Thomvis/BrightFutures)\n\n## License\n\nOAuthSwiftFutures is available under the MIT license. See the LICENSE file for more info.\n\n[![Join the chat at https://gitter.im/dongri/OAuthSwift](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dongri/OAuthSwift?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://mit-license.org)\n[![Platform](http://img.shields.io/badge/platform-iOS_OSX_TVOS-lightgrey.svg?style=flat)](https://developer.apple.com/resources/)\n[![Language](http://img.shields.io/badge/language-swift-orange.svg?style=flat)](https://developer.apple.com/swift)\n[![Cocoapod](http://img.shields.io/cocoapods/v/OAuthSwiftFutures.svg?style=flat)](http://cocoadocs.org/docsets/OAuthSwiftFutures/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauthswift%2Foauthswiftfutures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foauthswift%2Foauthswiftfutures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foauthswift%2Foauthswiftfutures/lists"}