This website uses cookies to better the user experience of its visitors. Where applicable, this website uses a cookie control system, allowing users to allow or disallow the use of cookies on their computer/device on their first visit to the website. This complies with recent legislative requirements for websites to obtain explicit consent from users before leaving behind or reading files such as cookies on a user’s computer/device. To learn more click Cookie Policy.

Privacy preference center

Cookies are small files saved to a user’s computer/device hard drive that track, save, and store information about the user’s interactions and website use. They allow a website, through its server, to provide users with a tailored experience within the site. Users are advised to take necessary steps within their web browser security settings to block all cookies from this website and its external serving vendors if they wish to deny the use and saving of cookies from this website to their computer’s/device’s hard drive. To learn more click Cookie Policy.

Manage consent preferences

These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
Cookies list
Name _rg_session
Provider rubygarage.org
Retention period 2 days
Type First party
Category Necessary
Description The website session cookie is set by the server to maintain the user's session state across different pages of the website. This cookie is essential for functionalities such as login persistence, ensuring a seamless and consistent user experience. The session cookie does not store personal data and is typically deleted when the browser is closed, enhancing privacy and security.
Name m
Provider m.stripe.com
Retention period 1 year 1 month
Type Third party
Category Necessary
Description The m cookie is set by Stripe and is used to help assess the risk associated with attempted transactions on the website. This cookie plays a critical role in fraud detection by identifying and analyzing patterns of behavior to distinguish between legitimate users and potentially fraudulent activity. It enhances the security of online transactions, ensuring that only authorized payments are processed while minimizing the risk of fraud.
Name __cf_bm
Provider .pipedrive.com
Retention period 1 hour
Type Third party
Category Necessary
Description The __cf_bm cookie is set by Cloudflare to support Cloudflare Bot Management. This cookie helps to identify and filter requests from bots, enhancing the security and performance of the website. By distinguishing between legitimate users and automated traffic, it ensures that the site remains protected from malicious bots and potential attacks. This functionality is crucial for maintaining the integrity and reliability of the site's operations.
Name _GRECAPTCHA
Provider .recaptcha.net
Retention period 6 months
Type Third party
Category Necessary
Description The _GRECAPTCHA cookie is set by Google reCAPTCHA to ensure that interactions with the website are from legitimate human users and not automated bots. This cookie helps protect forms, login pages, and other interactive elements from spam and abuse by analyzing user behavior. It is essential for the proper functioning of reCAPTCHA, providing a critical layer of security to maintain the integrity and reliability of the site's interactive features.
Name __cf_bm
Provider .calendly.com
Retention period 30 minutes
Type Third party
Category Necessary
Description The __cf_bm cookie is set by Cloudflare to distinguish between humans and bots. This cookie is beneficial for the website as it helps in making valid reports on the use of the website. By identifying and managing automated traffic, it ensures that analytics and performance metrics accurately reflect human user interactions, thereby enhancing site security and performance.
Name __cfruid
Provider .calendly.com
Retention period During session
Type Third party
Category Necessary
Description The __cfruid cookie is associated with websites using Cloudflare services. This cookie is used to identify trusted web traffic and enhance security. It helps Cloudflare manage and filter legitimate traffic from potentially harmful requests, thereby protecting the website from malicious activities such as DDoS attacks and ensuring reliable performance for genuine users.
Name OptanonConsent
Provider .calendly.com
Retention period 1 year
Type Third party
Category Necessary
Description The OptanonConsent cookie determines whether the visitor has accepted the cookie consent box, ensuring that the consent box will not be presented again upon re-entry to the site. This cookie helps maintain the user's consent preferences and compliance with privacy regulations by storing information about the categories of cookies the user has consented to and preventing unnecessary repetition of consent requests.
Name OptanonAlertBoxClosed
Provider .calendly.com
Retention period 1 year
Type Third party
Category Necessary
Description The OptanonAlertBoxClosed cookie is set after visitors have seen a cookie information notice and, in some cases, only when they actively close the notice. It ensures that the cookie consent message is not shown again to the user, enhancing the user experience by preventing repetitive notifications. This cookie helps manage user preferences and ensures compliance with privacy regulations by recording when the notice has been acknowledged.
Name referrer_user_id
Provider .calendly.com
Retention period 14 days
Type Third party
Category Necessary
Description The referrer_user_id cookie is set by Calendly to support the booking functionality on the website. This cookie helps track the source of referrals to the booking page, enabling Calendly to attribute bookings accurately and enhance the user experience by streamlining the scheduling process. It assists in managing user sessions and preferences during the booking workflow, ensuring efficient and reliable operation.
Name _calendly_session
Provider .calendly.com
Retention period 21 days
Type Third party
Category Necessary
Description The _calendly_session cookie is set by Calendly, a meeting scheduling tool, to enable the meeting scheduler to function within the website. This cookie facilitates the scheduling process by maintaining session information, allowing visitors to book meetings and add events to their calendars seamlessly. It ensures that the scheduling workflow operates smoothly, providing a consistent and reliable user experience.
Name _gat_UA-*
Provider rubygarage.org
Retention period 1 minute
Type First party
Category Analytics
Description The _gat_UA-* cookie is a pattern type cookie set by Google Analytics, where the pattern element in the name contains the unique identity number of the Google Analytics account or website it relates to. This cookie is a variation of the _gat cookie and is used to throttle the request rate, limiting the amount of data collected by Google Analytics on high traffic websites. It helps manage the volume of data recorded, ensuring efficient performance and accurate analytics reporting.
Name _ga
Provider rubygarage.org
Retention period 1 year 1 month 4 days
Type First party
Category Analytics
Description The _ga cookie is set by Google Analytics to calculate visitor, session, and campaign data for the site's analytics reports. It helps track how users interact with the website, providing insights into site usage and performance.
Name _ga_*
Provider rubygarage.org
Retention period 1 year 1 month 4 days
Type First party
Category Analytics
Description The _ga_* cookie is set by Google Analytics to store and count page views on the website. This cookie helps track the number of visits and interactions with the website, providing valuable data for performance and user behavior analysis. It belongs to the analytics category and plays a crucial role in generating detailed usage reports for site optimization.
Name _gid
Provider rubygarage.org
Retention period 1 day
Type First party
Category Analytics
Description The _gid cookie is set by Google Analytics to store information about how visitors use a website and to create an analytics report on the website's performance. This cookie collects data on visitor behavior, including pages visited, duration of the visit, and interactions with the website, helping site owners understand and improve user experience. It is part of the analytics category and typically expires after 24 hours.
Name _dc_gtm_UA-*
Provider rubygarage.org
Retention period 1 minute
Type First party
Category Analytics
Description The _dc_gtm_UA-* cookie is set by Google Analytics to help load the Google Analytics script tag via Google Tag Manager. This cookie facilitates the efficient loading of analytics tools, ensuring that data on user behavior and website performance is accurately collected and reported. It is categorized under analytics and assists in the seamless integration and functioning of Google Analytics on the website.

AuthorizeMe: the iOS Library for Social Login

  • 17441 views
  • 7 min
  • Jul 21, 2017
Radislav C.

Radislav C.

IOS Developer

Maryna Z.

Maryna Z.

Copywriter

Share

Login with social networks like Google and Facebook is vital to many apps because users don’t want to spend their time entering usernames and passwords. It’s proven that social logins reduce user friction and cart abandonment on ecommerce services. That’s why business owners are concerned with enabling users to log in with social networks.

To implement social login, developers often resort to ready-made libraries. For example, our iOS team has been using the SimpleAuth library for a while. However, despite the advantages of ready-made solutions (saving time), they don’t always meet our requirements. That’s why we decided to create an analogue of SimpleAuth, only better.

This is why we developed AuthorizeMe ‒ a library that enables iOS developers to implement social login features in a few steps.

What is AuthorizeMe?

AuthorizeMe is a library for iOS that implements login via Facebook, Google, LinkedIn, Instagram, and Twitter. The library contains the source code with providers for each social network. Providers retrieve user credentials (logins and passwords) to provide users with tokens that give access to social network data.

Advantages of AuthorizeMe

The features of AuthorizeMe are built on top of SimpleAuth’s functionality. Put simply, we listed the drawbacks of SimpleAuth and got rid of them when developing the AuthorizeMe library. Here’s what we got.

No Dependencies

Experienced developers know that dependencies are a bad practice that causes programmers to tweak their code every time there’s an update to a dependency.

For example, let’s say we have an A-library that depends on the B-dependency (for example, the B-library). The next time the developers of B-library make modifications, the developers of A-library will have to rewrite their code so it complies with the latest version of B-library. Consequently, developers that use A-library might need to rewrite their code because of these changes to A-library.

SimpleAuth is dependant on five other libraries, using only a few methods from each library. Such use of resources is unreasonable.

Written in Swift

AuthorizeMe is written in Swift, a state-of-the art programming language presented by Apple in 2014. Swift was designed as an alternative to Objective-C, which prevailed in iOS development at the time. Today, Swift is constantly gaining popularity and is predicted to fully replace its rival, Objective-C.

Plenty of iOS applications for top-notch products like Firefox, WordPress, Hacker News, SoundCloud, and Artsy are built with Swift. Lyft got on board with Swift as well: in 2015, Lyft rewrote their app in Swift (the initial Lyft app was written in Objective-C).

Advantages of Swift over Objective-C include:

  • Better safety. Swift doesn’t use pointers as Objective-C does, and is more resilient to invalid code.
  • Fewer lines of code. After Lyft rewrote their app, it totalled 25,000 lines of code instead of 75,000 ‒ pretty impressive, right?
  • Shorter TTM (Time to Market). Swift helps startups reduce time to market by introducing package managers ‒ tools that speed up the process of assembling an app.
  • Better readability. Swift resembles regular English just like Ruby, Python, and Java do. That’s why its syntax is easy to read and learn.
  • Interactivity. With Swift Playgrounds, developers can rapidly visualize their code and check if everything is correct. Playgrounds tools allow for various experiments without having to compile code.

Considering that many existing projects have switched to Swift while new projects prefer this language over Objective-C, we decided to write our library in Swift, unlike SimpleAuth which is written in Objective-C.

Ability to Add Custom Providers

AuthorizeMe is built on top of class providers that implement authorization functionality. Currently, the library supports five predetermined providers for the most popular networks including Google and Facebook.

But if you can’t find a social network or service (like Dropbox or Foursquare) that you’d like your users to be able to authorize with, that not an issue. With AuthorizeMe, you’re able to create custom providers for any service. Simply use the API for the service you’d like to integrate with AuthorizeMe.

Detailed Wikis

GitHub contributors often get carried away with writing code. As a result, other important project components like documentation, wikis, examples, and manuals are often overlooked. In fact, a recent survey shows that 93% of respondents name incomplete or out-of-date documentation as a top problem of open source software.

The AuthorizeMe library boasts comprehensive wikis that explain each piece of functionality in detail. There’s an installation guide as well as detailed step-by-step manuals on how to use each of five predetermined providers and how to implement a custom provider.

Maintenance and Support

Since AuthorizeMe is a brand new library, it’s well maintained and supported. Unlike SimpleAuth, which hasn’t been supported for two years already, our library stays up to date with the latest updates. Therefore, if a provider makes changes or modifications to its API, our team will rapidly fix the code to prevent issues like app crashes.

How to Install the FacebookProvider

In order to show you how easy it is to work with AuthorizeMe, we’ll explain how to install the FacebookProvider.

Step 1. Create an application

  1. Log in to the Facebook for Developers website.
  2. Hover over the My Apps menu and select the Add a New App option.
  3. Fill in the Display Name and Contact Email fields.
  4. Click the Create App ID button.

Step 2. Create and configure a test application

  1. Click Display Name button in the upper-left corner.
  2. Press the Create a Test App button.
  3. Change Test App Name if necessary and click Create Test App.

Click the Settings button in the left corner. A Basic Settings mode will be selected by default. In basic settings you’ll find App ID parameters, which are required for the FacebookProvider.

  1. Click the Add Platform button and choose iOS.
  2. Fill in the Bundle ID field with the data from the Bundle Identifier field in your Xcode project.
  3. Click Save Changes.
  4. Toggle the Native or Desktop App? button to the active mode in the Advanced Settings tab.

Step 3. Create and Configure Facebook Login Product

  1. Add a new product by tapping the Add Product button on the left.
  2. Find the Facebook Login product and click the Get Started button.
  3. Fill in the Valid OAuth redirect URIs field on the Facebook Login Settings tab.Notice that this is the second parameter required for a FacebookProvider.

Step 4. Create and Configure a Plist File

  1. Create a Facebook.plist file and add the following code to the file:

Step 5. Use the Framework

  1. Use the Authorize manager, which authorizes a user with FacebookSystemProvider if possible. In other case, the manager authorizes a user with FacebookWebProvider.
  2. In order to distinguish between use of these two providers, use FacebookSystemProvider and FacebookWebProvider separately.

AuthorizeMe and the iOS 11 Update

The AuthorizeMe library is built on provider classes: there’s a basic provider class that inherits provider classes of social networks and services. For example, the FacebookProvider class inherits two classes: FacebookSystemProvider and FacebookWebProvider.

This first provider retrieves data from system accounts if a user is signed in via a device’s settings. The second provider uses WebView for sign-in: a user fills in data in WebView to authorize and gets a token.

In addition to providers, AuthorizeMe has an Authorize class wrapper. When users try to sign in to their Facebook accounts, Authorize attempts to authorize with the help of a system provider, and if that attempt fails, with the help of a web provider. Not all social networks and services have a system provider, since system settings in iOS provide the ability to authorize only with four social networks.

In addition, Apple has completely eliminated system authorization in iOS 11.Frankly speaking, this was an unexpected update, since we were in the middle of developing AuthorizeMe; however, we took this into consideration and fixed the problem.

To handle the issue of system authorization, you can follow one of two methods. With iOS 11 and higher, you’re only able to authorize via a browser. If you use the AuthorizeMe library on devices running iOS 11 or higher, you’ll get a notification that authorization with system accounts has been deprecated.

On devices with iOS 10, you can try to authorize with a system account, and if that fails, then attempt authorization via a browser.

We’d be glad if you used the AuthorizeMe library in your iOS app and shared your feedback with us! Also, if you’d like to contribute to the AuthorizeMe project or suggest further improvements, feel free to visit our GitHub and start a discussion on Twitter!

CONTENTS

Authors:

Radislav C.

Radislav C.

IOS Developer

Maryna Z.

Maryna Z.

Copywriter

Rate this article!

Nay
So-so
Not bad
Good
Wow
3 rating, average 4.67 out of 5

Share article with

Comments (2)
Bruce Bookman
Bruce Bookman over 6 years ago
"Fill in the Valid OAuth redirect URIs field on the Facebook Login Settings tab.Notice that this is the second parameter required for a FacebookProvider." Fill in with what exactly? How do I get a Valid OAuth redirect URI?
Reply
Maryna Z.
Maryna Z. over 6 years ago
Hi Bruce! Actually, you can use any URL - it's all up to you. On GitHub, we have an example with a screenshot in Step 3 that includes RubyGarage's website URL: https://rubygarage.org/. So, if you develop an authorizaton feature for a mobile app that has a website, you can use your website URL. So, one can use any URL and the library will handle it. The only thing that matters is the same URL in a Facebook admin panel and a library configuration file. Remember about that :)
Reply

Subscribe via email and know it all first!