{"id":13428618,"url":"https://github.com/SimplicityMobile/Simplicity","last_synced_at":"2025-03-16T01:32:46.380Z","repository":{"id":62455588,"uuid":"58500595","full_name":"SimplicityMobile/Simplicity","owner":"SimplicityMobile","description":"A simple way to implement Facebook and Google login in your iOS apps.","archived":false,"fork":false,"pushed_at":"2019-06-21T15:26:31.000Z","size":62,"stargazers_count":679,"open_issues_count":15,"forks_count":66,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-18T08:51:51.418Z","etag":null,"topics":["facebook","google","ios","login","oauth"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimplicityMobile.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":"2016-05-10T23:51:08.000Z","updated_at":"2025-02-01T05:05:10.000Z","dependencies_parsed_at":"2022-11-02T00:01:21.282Z","dependency_job_id":null,"html_url":"https://github.com/SimplicityMobile/Simplicity","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplicityMobile%2FSimplicity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplicityMobile%2FSimplicity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplicityMobile%2FSimplicity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimplicityMobile%2FSimplicity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimplicityMobile","download_url":"https://codeload.github.com/SimplicityMobile/Simplicity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814905,"owners_count":20352037,"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":["facebook","google","ios","login","oauth"],"created_at":"2024-07-31T01:01:01.831Z","updated_at":"2025-03-16T01:32:46.055Z","avatar_url":"https://github.com/SimplicityMobile.png","language":"Swift","funding_links":[],"categories":["Authentication","Libs"],"sub_categories":["Other free courses","Getting Started","Authentication"],"readme":"# Simplicity\n\n[![Version](https://img.shields.io/cocoapods/v/Simplicity.svg?style=flat)](http://cocoapods.org/pods/Simplicity)\n[![License](https://img.shields.io/cocoapods/l/Simplicity.svg?style=flat)](http://cocoapods.org/pods/Simplicity)\n[![Platform](https://img.shields.io/cocoapods/p/Simplicity.svg?style=flat)](http://cocoapods.org/pods/Simplicity) [![codebeat badge](https://codebeat.co/badges/be32bb87-36e8-47e3-9324-5eae153a4d6d)](https://codebeat.co/projects/github-com-simplicitymobile-simplicity)\n[![Slack Status](https://talkstormpath.shipit.xyz/badge.svg)](https://talkstormpath.shipit.xyz)\n\nSimplicity is a simple way to implement Facebook and Google login in your iOS apps. \n\nSimplicity can be easily extended to support other external login providers, including OAuth2, OpenID, SAML, and other custom protocols, and will support more in the future. We always appreciate pull requests!\n\n## Why use Simplicity?\n\nFacebook and Google's SDKs are heavyweight, and take time to set up and use. You can use Simplicity and only have to manage one SDK for logging in with an external provider in your app. Simplicity adds just 200KB to your app's binary, compared to 5.4MB when using the Facebook \u0026 Google SDKs. \n\nSimplicity is also extensible, and already supports other login providers, like VKontakte (the largest European social network) and generic OAuth providers. \n\nLogging in with Simplicity is as easy as:\n\n```Swift\nSimplicity.login(Facebook()) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Stormpath\n\nSimplicity is maintained by [Stormpath](https://stormpath.com), an API service for authentication, authorization, and user management. If you're building a backend API for your app, consider using Stormpath to help you implement a secure REST API. Read our tutorial on how to [build a REST API for your mobile apps using Node.js](https://stormpath.com/blog/tutorial-build-rest-api-mobile-apps-using-node-js).\n\n## Installation\n\nRequires XCode 8+ / Swift 3+\n\nTo install Simplicity, we use [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod 'Simplicity'\n```\n\n**Carthage**\n\nTo use Simplicity with [Carthage](https://github.com/Carthage/Carthage), specify it in your `Cartfile`:\n\n```ogdl\ngithub \"SimplicityMobile/Simplicity\"\n```\n\n**Swift 2**\n\nOlder versions of Simplicity support Swift 2.3 (Xcode 8) or Swift 2.2 (Xcode 7).\n\n* Swift 2.3 support is on branch [`swift2.3`](https://github.com/SimplicityMobile/Simplicity/tree/swift2.3)\n* Swift 2.2 support is on version [`1.x`](https://github.com/SimplicityMobile/Simplicity/tree/1.0.2)\n\n### Add the link handlers to the AppDelegate\n\nWhen a user finishes their log in flow, Facebook or Google will redirect back into the app. Simplicity will listen for the access token or error. You need to add the following lines of code to `AppDelegate.swift`:\n\n```Swift\nimport Simplicity\n\nfunc application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -\u003e Bool {\n    return Simplicity.application(app, open: url, options: options)\n}\n\nfunc application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -\u003e Bool {\n    return Simplicity.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)\n}\n```\n\n# Usage\n\nSimplicity is very flexible and supports a number of configuration options for your login providers. To view, please see the [full API docs on CocoaDocs](http://cocoadocs.org/docsets/Simplicity/). \n\n## Using Facebook Login\n \nTo get started, you first need to [register an application](https://developers.facebook.com/?advanced_app_create=true) with Facebook. After registering your app, go into your app dashboard's settings page. Click \"Add Platform\", and fill in your Bundle ID, and turn \"Single Sign On\" on.\n\nFinally, open up your App's Xcode project and go to the project's info tab. Under \"URL Types\", add a new entry, and in the URL schemes form field, type in `fb[APP_ID_HERE]`, replacing `[APP_ID_HERE]` with your Facebook App ID.\n\nThen, you can initiate the login screen by calling:\n\n```Swift\nSimplicity.login(Facebook()) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\nBy request, you can also call `.login` on any `LoginProvider`: \n\n```Swift\nFacebook().login { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Using Google Login\n\nTo get started, you first need to [register an application](https://console.developers.google.com/project) with Google. Click \"Enable and Manage APIs\", and then the [credentials tab](https://console.developers.google.com/apis/credentials). Create an OAuth Client ID for \"iOS\". \n\nNext, open up your App's Xcode project and go to the project's info tab. Under \"URL Types\", add a new entry, and in the URL schemes form field, type in your Google iOS Client's `iOS URL scheme` from the Google Developer Console.\n\nThen, you can initiate the login screen by calling:\n\n```Swift\nSimplicity.login(Google()) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Using VKontakte Login\n\nTo get started, you first need to [create an application](https://vk.com/dev/) with VKontakte. \nAfter registering your app, go into your client settings page.\nSet App Bundle ID for iOS to your App Bundle in Xcode -\u003e Target -\u003e Bundle Identifier (e.g. com.developer.applicationName)\n\nFinally, open up your App's Xcode project and go to the project's\ninfo tab. Under \"URL Types\", add a new entry, and in the URL schemes form\nfield, type in `vk[CLIENT_ID_HERE]`. Then, you can initiate the login\nscreen by calling:\n\n```\nSimplicity.login(VKontakte()) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Generic OAuth Provider\n\nSimplicity supports any OAuth provider that implements the Implicit grant type. \n\n```Swift\nlet provider = OAuth2(clientId: clientId, authorizationEndpoint: authorizationEndpoint, redirectEndpoint: redirectEndpoint, grantType: .Implicit)\n\nSimplicity.login(provider) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Requesting Scopes for OAuth Providers\n\nIf you need custom scopes, you can modify the Facebook or Google object to get them. \n\n```Swift\nlet facebook = Facebook()\nfacebook.scopes = [\"public_profile\", \"email\", \"user_friends\"]\n\nSimplicity.login(facebook) { (accessToken, error) in\n  // Handle access token here\n}\n```\n\n## Twitter, LinkedIn, and GitHub\n\nWe can't implement Twitter, GitHub, LinkedIn, Slack, or other login types because we can't do authorization_code grants without a client secret. Client secrets are fundamentally insecure on mobile clients, so we need to create a companion server to help with the authentication request.\n\nIf this is something you'd like to see, please +1 or follow this [GitHub Issue to create a companion server](https://github.com/SimplicityMobile/Simplicity/issues/1) so I know that there's demand for this. \n\n## Other External Login Providers\n\nWant another external login provider implemented? Please [open a GitHub issue](https://github.com/SimplicityMobile/Simplicity/issues) so I know it's in demand, or consider contributing to this project!\n\n## Contributing\n\nPlease send a pull request with your new LoginProvider implemented. LoginProviders should try to autoconfigure where possible. \n\n## License\n\nSimplicity is available under the Apache 2.0 license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimplicityMobile%2FSimplicity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSimplicityMobile%2FSimplicity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimplicityMobile%2FSimplicity/lists"}