[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6982":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},6982,"OAuthSwift","OAuthSwift\u002FOAuthSwift","Swift based OAuth library for iOS","",null,"Swift",3333,590,87,43,0,1,60.41,"MIT License",false,"master",true,[23,24,25,26,27,28,29],"oauth","oauth-client","oauth1","oauth2","oauth2-authentication","oauth2-client","oauthswift","2026-06-12 04:00:31","\u003Cp align=\"center\">\n  \u003Cimg src=\"Assets\u002FOAuthSwift-icon.png?raw=true\" alt=\"OAuthSwift\"\u002F>\n\u003C\u002Fp>\n\n# OAuthSwift\n\nSwift based OAuth library for iOS and macOS.\n\n## Support OAuth1.0, OAuth2.0\n\nTwitter, Flickr, Github, Instagram, Foursquare, Fitbit, Withings, Linkedin, Dropbox, Dribbble, Salesforce, BitBucket, GoogleDrive, Smugmug, Intuit, Zaim, Tumblr, Slack, Uber, Gitter, Facebook, Spotify, Typetalk, SoundCloud, Twitch, Reddit, etc\n\n## Installation\n\nOAuthSwift is packaged as a Swift framework. Currently this is the simplest way to add it to your app:\n\n* Drag OAuthSwift.xcodeproj to your project in the Project Navigator.\n* Select your project and then your app target. Open the Build Phases panel.\n* Expand the Target Dependencies group, and add OAuthSwift framework.\n* import OAuthSwift whenever you want to use OAuthSwift.\n\n### Support Carthage\n\n* Install Carthage (https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n* Create `Cartfile` file\n\n```text\ngithub \"OAuthSwift\u002FOAuthSwift\" ~> 2.2.0\n```\n\n* Run `carthage update`.\n* On your application targets’ “General” settings tab, in the “Embedded Binaries”\nsection, drag and drop OAuthSwift.framework from the Carthage\u002FBuild\u002FiOS folder on disk.\n\n### Support CocoaPods\n\n* Podfile\n\n```ruby\nplatform :ios, '10.0'\nuse_frameworks!\n\npod 'OAuthSwift', '~> 2.2.0'\n```\n\n### Swift Package Manager Support\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyApp\",\n    dependencies: [\n        .package(name: \"OAuthSwift\",\n            url: \"https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthSwift.git\",\n            .upToNextMajor(from: \"2.2.0\"))\n    ]\n)\n```\n\n### Old versions\n\n#### Swift 3\n\nUse the `swift3` branch, or the tag `1.1.2` on main branch\n\n#### Swift 4\n\nUse the tag `1.2.0` on main branch\n\n#### Objective-C\n\nUse the tag `1.4.1` on main branch\n\n## How to\n\n### Setting URL Schemes\n\nIn info tab of your target\n![Image](Assets\u002FURLSchemes.png \"Image\")\nReplace oauth-swift by your application name\n\n### Handle URL in AppDelegate\n\n- On iOS implement `UIApplicationDelegate` method\n\n```swift\nfunc application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey  : Any] = [:]) -> Bool {\n  if url.host == \"oauth-callback\" {\n    OAuthSwift.handle(url: url)\n  }\n  return true\n}\n```\n\n- On iOS 13, UIKit will notify `UISceneDelegate` instead of `UIApplicationDelegate`.\n- Implement `UISceneDelegate` method\n\n```swift\nfunc scene(_ scene: UIScene, openURLContexts URLContexts: Set\u003CUIOpenURLContext>) {\n        guard let url = URLContexts.first?.url else {\n            return\n        }\n        if url.host == \"oauth-callback\" {\n            OAuthSwift.handle(url: url)\n        }\n}\n```\n\n:warning: Any other application may try to open a URL with your url scheme. So you can check the source application, for instance for safari controller :\n\n```swift\nif options[.sourceApplication] as? String == \"com.apple.SafariViewService\" {\n```\n\n- On macOS you must register a handler on `NSAppleEventManager` for event type `kAEGetURL` (see demo code)\n\n```swift\nfunc applicationDidFinishLaunching(_ aNotification: NSNotification) {\n    NSAppleEventManager.shared().setEventHandler(self, andSelector:#selector(AppDelegate.handleGetURL(event:withReplyEvent:)), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL))\n}\nfunc handleGetURL(event: NSAppleEventDescriptor!, withReplyEvent: NSAppleEventDescriptor!) {\n    if let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue, let url = URL(string: urlString) {\n        OAuthSwift.handle(url: url)\n    }\n}\n```\n\n### Authorize with OAuth1.0\n\n```swift\n\u002F\u002F create an instance and retain it\noauthswift = OAuth1Swift(\n    consumerKey:    \"********\",\n    consumerSecret: \"********\",\n    requestTokenUrl: \"https:\u002F\u002Fapi.twitter.com\u002Foauth\u002Frequest_token\",\n    authorizeUrl:    \"https:\u002F\u002Fapi.twitter.com\u002Foauth\u002Fauthorize\",\n    accessTokenUrl:  \"https:\u002F\u002Fapi.twitter.com\u002Foauth\u002Faccess_token\"\n)\n\u002F\u002F authorize\nlet handle = oauthswift.authorize(\n    withCallbackURL: \"oauth-swift:\u002F\u002Foauth-callback\u002Ftwitter\") { result in\n    switch result {\n    case .success(let (credential, response, parameters)):\n      print(credential.oauthToken)\n      print(credential.oauthTokenSecret)\n      print(parameters[\"user_id\"])\n      \u002F\u002F Do your request\n    case .failure(let error):\n      print(error.localizedDescription)\n    }             \n}\n```\n\n### OAuth1 without authorization\n\nNo urls to specify here\n\n```swift\n\u002F\u002F create an instance and retain it\noauthswift = OAuth1Swift(\n    consumerKey:    \"********\",\n    consumerSecret: \"********\"\n)\n\u002F\u002F do your HTTP request without authorize\noauthswift.client.get(\"https:\u002F\u002Fapi.example.com\u002Ffoo\u002Fbar\") { result in\n    switch result {\n    case .success(let response):\n        \u002F\u002F....\n    case .failure(let error):\n        \u002F\u002F...\n    }\n}\n```\n\n### Authorize with OAuth2.0\n\n```swift\n\u002F\u002F create an instance and retain it\noauthswift = OAuth2Swift(\n    consumerKey:    \"********\",\n    consumerSecret: \"********\",\n    authorizeUrl:   \"https:\u002F\u002Fapi.instagram.com\u002Foauth\u002Fauthorize\",\n    responseType:   \"token\"\n)\nlet handle = oauthswift.authorize(\n    withCallbackURL: \"oauth-swift:\u002F\u002Foauth-callback\u002Finstagram\",\n    scope: \"likes+comments\", state:\"INSTAGRAM\") { result in\n    switch result {\n    case .success(let (credential, response, parameters)):\n      print(credential.oauthToken)\n      \u002F\u002F Do your request\n    case .failure(let error):\n      print(error.localizedDescription)\n    }\n}\n```\n\n### Authorize with OAuth2.0 and proof key flow (PKCE)\n\n```swift\n\u002F\u002F create an instance and retain it\noauthswift = OAuth2Swift(\n    consumerKey:    \"********\",\n    consumerSecret: \"********\",\n    authorizeUrl: \"https:\u002F\u002Fserver.com\u002Foauth\u002Fauthorize\",\n    responseType: \"code\"\n)\noauthswift.accessTokenBasicAuthentification = true\n\nguard let codeVerifier = generateCodeVerifier() else {return}\nguard let codeChallenge = generateCodeChallenge(codeVerifier: codeVerifier) else {return}\n\nlet handle = oauthswift.authorize(\n    withCallbackURL: \"myApp:\u002F\u002Fcallback\u002F\",\n    scope: \"requestedScope\", \n    state:\"State01\",\n    codeChallenge: codeChallenge,\n    codeChallengeMethod: \"S256\",\n    codeVerifier: codeVerifier) { result in\n    switch result {\n    case .success(let (credential, response, parameters)):\n      print(credential.oauthToken)\n      \u002F\u002F Do your request\n    case .failure(let error):\n      print(error.localizedDescription)\n    }\n}\n```\n\nSee demo for more examples\n\n### Handle authorize URL\nThe authorize URL allows the user to connect to a provider and give access to your application.\n\nBy default this URL is opened into the external web browser (ie. safari), but apple does not allow it for app-store iOS applications.\n\nTo change this behavior you must set an `OAuthSwiftURLHandlerType`, simple protocol to handle an `URL`\n\n```swift\noauthswift.authorizeURLHandler = ..\n```\n\nFor instance you can embed a web view into your application by providing a controller that displays a web view (`UIWebView`, `WKWebView`).\nThen this controller must implement `OAuthSwiftURLHandlerType` to load the URL into the web view\n\n```swift\nfunc handle(_ url: NSURL) {\n  let req = URLRequest(URL: targetURL)\n  self.webView.loadRequest(req)\n  ...\n```\n\nand present the view (`present(viewController`, `performSegue(withIdentifier: `, ...)\n*You can extend `OAuthWebViewController` for a default implementation of view presentation and dismiss*\n\n#### Use the SFSafariViewController (iOS9)\n\nA default implementation of `OAuthSwiftURLHandlerType` is provided using the `SFSafariViewController`, with automatic view dismiss.\n\n```swift\noauthswift.authorizeURLHandler = SafariURLHandler(viewController: self, oauthSwift: oauthswift)\n```\n\nOf course you can create your own class or customize the controller by setting the variable `SafariURLHandler#factory`.\n\n### Make signed request\n\nJust call HTTP functions of `oauthswift.client`\n\n```swift\noauthswift.client.get(\"https:\u002F\u002Fapi.linkedin.com\u002Fv1\u002Fpeople\u002F~\") { result in\n    switch result {\n    case .success(let response):\n        let dataString = response.string\n        print(dataString)\n    case .failure(let error):\n        print(error)\n    }\n}\n\u002F\u002F same with request method\noauthswift.client.request(\"https:\u002F\u002Fapi.linkedin.com\u002Fv1\u002Fpeople\u002F~\", .GET,\n      parameters: [:], headers: [:],\n      completionHandler: { ...\n```\n\nSee more examples in the demo application: [ViewController.swift](\u002FDemo\u002FCommon\u002FViewController.swift)\n\n## OAuth provider pages\n\n* [Twitter](https:\u002F\u002Fdev.twitter.com\u002Foauth)  \n* [Flickr](https:\u002F\u002Fwww.flickr.com\u002Fservices\u002Fapi\u002Fauth.oauth.html)  \n* [Github](https:\u002F\u002Fdeveloper.github.com\u002Fv3\u002Foauth\u002F)  \n* [Instagram](https:\u002F\u002Fdevelopers.facebook.com\u002Fdocs\u002Finstagram-basic-display-api\u002Fguides\u002Fgetting-access-tokens-and-permissions)  \n* [Foursquare](https:\u002F\u002Fdeveloper.foursquare.com\u002Foverview\u002Fauth)  \n* [Fitbit](https:\u002F\u002Fdev.fitbit.com\u002Fbuild\u002Freference\u002Fweb-api\u002Foauth2\u002F)  \n* [Withings](http:\u002F\u002Foauth.withings.com\u002Fapi)  \n* [LinkedIn](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Flinkedin\u002Fshared\u002Fauthentication\u002Fauthentication)  \n* [Dropbox](https:\u002F\u002Fwww.dropbox.com\u002Fdevelopers\u002Fdocumentation\u002Fhttp\u002Fdocumentation)  \n* [Dribbble](https:\u002F\u002Fdeveloper.dribbble.com\u002Fv2\u002F#authentication)\n* [Salesforce](https:\u002F\u002Fdeveloper.salesforce.com\u002Fdocs\u002Fatlas.en-us.api_rest.meta\u002Fapi_rest\u002F)\n* [BitBucket](https:\u002F\u002Fconfluence.atlassian.com\u002Fbitbucket\u002Foauth-on-bitbucket-cloud-238027431.html)\n* [GoogleDrive](https:\u002F\u002Fdevelopers.google.com\u002Fdrive\u002Fv2\u002Freference\u002F)\n* [Smugmug](https:\u002F\u002Fsmugmug.atlassian.net\u002Fwiki\u002Fdisplay\u002FAPI\u002FOAuth)\n* [Intuit](https:\u002F\u002Fdeveloper.intuit.com\u002Fapp\u002Fdeveloper\u002Fqbo\u002Fdocs\u002Fdevelop\u002Fauthentication-and-authorization)\n* [Zaim](https:\u002F\u002Fdev.zaim.net\u002Fhome\u002Fapi\u002Fauthorize)\n* [Tumblr](https:\u002F\u002Fwww.tumblr.com\u002Fdocs\u002Fen\u002Fapi\u002Fv2#auth)\n* [Slack](https:\u002F\u002Fapi.slack.com\u002Fdocs\u002Foauth)\n* [Uber](https:\u002F\u002Fdeveloper.uber.com\u002Fdocs\u002Fride-requests\u002Fguides\u002Fauthentication\u002Fintroduction#oauth-20)\n* [Gitter](https:\u002F\u002Fdeveloper.gitter.im\u002Fdocs\u002Fauthentication)\n* [Facebook](https:\u002F\u002Fdevelopers.facebook.com\u002Fdocs\u002Ffacebook-login)\n* [Spotify](https:\u002F\u002Fdeveloper.spotify.com\u002Fweb-api\u002Fauthorization-guide\u002F)\n* [Trello](https:\u002F\u002Fdevelopers.trello.com\u002Fauthorize)\n* [Buffer](https:\u002F\u002Fbuffer.com\u002Fdevelopers\u002Fapi\u002Foauth)\n* [Goodreads](https:\u002F\u002Fwww.goodreads.com\u002Fapi\u002Fdocumentation#oauth)\n* [Typetalk](http:\u002F\u002Fdeveloper.nulab-inc.com\u002Fdocs\u002Ftypetalk\u002Fauth)\n* [SoundCloud](https:\u002F\u002Fdevelopers.soundcloud.com\u002Fdocs\u002Fapi\u002Fguide#authentication)\n* [Doper](https:\u002F\u002Fdoper.io\u002Fdeveloper\u002Foauth)\n* [NounProject](http:\u002F\u002Fapi.thenounproject.com\u002Fgetting_started.html#authentication)\n* [Reddit](https:\u002F\u002Fgithub.com\u002Freddit-archive\u002Freddit\u002Fwiki\u002Foauth2)\n\n## Images\n\n![Image](Assets\u002FServices.png \"Image\")\n![Image](Assets\u002FTwitterOAuth.png \"Image\")\n![Image](Assets\u002FTwitterOAuthTokens.png \"Image\")\n\n## Contributing\n\nSee [CONTRIBUTING.md](.github\u002FCONTRIBUTING.md)\n\n[Add a new service in demo app](https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthSwift\u002Fwiki\u002FDemo-application#add-a-new-service-in-demo-app)\n\n## Integration\n\nOAuthSwift could be used with others frameworks\n\nYou can sign [Alamofire](https:\u002F\u002Fgithub.com\u002FAlamofire\u002FAlamofire) request with [OAuthSwiftAlamofire](https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthSwiftAlamofire)\n\nTo achieve great asynchronous code you can use one of these integration frameworks\n\n- [OAuthSwiftFutures](https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthSwiftFutures) - [BrightFutures](https:\u002F\u002Fgithub.com\u002FThomvis\u002FBrightFutures)\n- [OAuthRxSwift](https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthRxSwift) - [RxSwift](https:\u002F\u002Fgithub.com\u002FReactiveX\u002FRxSwift)\n- [OAuthReactiveSwift](https:\u002F\u002Fgithub.com\u002FOAuthSwift\u002FOAuthReactiveSwift) - [ReactiveSwift](https:\u002F\u002Fgithub.com\u002FReactiveCocoa\u002FReactiveSwift)\n\n## License\n\nOAuthSwift is available under the MIT license. See the LICENSE file for more info.\n\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg?style=flat\n            )](http:\u002F\u002Fmit-license.org) [![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-iOS_OSX_TVOS-lightgrey.svg?style=flat\n             )](https:\u002F\u002Fdeveloper.apple.com\u002Fresources\u002F) [![Language](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flanguage-swift-orange.svg?style=flat\n             )](https:\u002F\u002Fdeveloper.apple.com\u002Fswift) [![Cocoapod](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FOAuthSwift.svg?style=flat)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FOAuthSwift\u002F)\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) [![Build Status](https:\u002F\u002Ftravis-ci.org\u002FOAuthSwift\u002FOAuthSwift.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002FOAuthSwift\u002FOAuthSwift)\n","OAuthSwift 是一个基于 Swift 的 OAuth 库，适用于 iOS 和 macOS 平台。它支持 OAuth1.0 和 OAuth2.0 协议，并且能够与 Twitter、GitHub、Facebook 等多个知名服务进行集成认证。项目提供了多种安装方式，包括通过 Xcode 框架直接添加、使用 Carthage 或 CocoaPods 依赖管理工具以及 Swift Package Manager。此外，还详细说明了如何在应用中设置 URL Schemes 及处理回调 URL，确保开发者可以顺利实现第三方登录功能。OAuthSwift 适合需要快速集成 OAuth 认证机制的 iOS 或 macOS 应用开发场景。",2,"2026-06-11 03:09:59","top_language"]