Soon Hin Khor

How to Accelerate User Growth and Acquire Accurate User Data with OAuth.io

How to Accelerate User Growth and Acquire Accurate User Data with OAuth.io

Users are the lifeblood of web services, and growing users is paramount to the sustenance of the web services. Find out how you can accelerate user growth by implementing social connect buttons in 5 minutes.

The Era of ‘Perennially Logged In’

Social network users are always active, and thus are perennially logged in to their various social networks; do you remember when was the last time your social network, e.g., Facebook, Twitter, Linked-In, Quora, etc., account prompted you for your credentials? Chances are it has never happened since you joined it, and you probably don’t even remember your credentials anymore.

Social networks are vested in keeping you logged in because they understand that logging out users dampens engagement; imagine trying to share an exhilarating experience with your friends and you get:

Logging out users introduces inconvenience, at the very least, requiring the user to enter her credentials, or vexation, at the very worst, forcing them through the hassle of resetting their credentials if they have forgotten it, up to 92% will abandon the site under this scenario.

Tapping on the Power of Social Networks

Since social networks are so good at keeping users signed-in, your web service should tap on the seamless beauty of onboarding social network users with just a single click.

Imagine if you were an online resume site; see how powerful an impression the ‘Import from Linkedin’ button creates.

The alternative would be onboarding users with an abomination like this:

For non-resume sites, e.g., dating/friendship sites, etc., they have an additional issue to contend with during user onboarding — fake user data.

Research shows that 88% of user-provided fake data during signup, which can be mitigated by social logins; it is harder to lie on a social network since the information is vetted (e.g., career, education, etc.) by thousands of eyes, or even by the system (e.g., current location, number of followers, etc.). If with just a click you could onboard the user with more accurate data, it is to your advantage.

OAuth is Complicated and Implementation is a Time Sink

If you have read this far, you probably think social login is a good idea, but the implementation effort required may make it a non-starter. You would be forgiven thinking implementation takes a boatload of time because:

A Standard So Loose That It Does Not Standardize Enough

Social login is based on OAuth/OAuth2, which is a loosely defined standard resulting in social login providers (also known as OAuth/OAuth2 providers) implementing the OAuth/OAuth2 with their own peculiarities.

The Wild West Of OAuth Provider API Endpoints

Each OAuth/OAuth2 provider offers different API endpoints that are specific to their service, e.g., Twitter, Facebook, LinkedIn may all have API endpoints to retrieve user data, but each API endpoint returns different subsets of user data, and over time the number of API endpoints will grow/shrink/change leaving you in total confusion which API endpoints are deprecated, which one to call to retrieve a certain piece of data, etc.

You Don’t Become A Carpenter to Open A Cafe

Signup/login flows are utilities required to operate a web service, but they are not your main business. You should not have to spend hours learning about OAuth/OAuth2 in-depth, and then spend more time cobbling the front-end and backend code needed to complete the signup/login flow.

The Panacea

Fortunately, all the above problems are no longer true, because of OAuth.io.

Standardizing the Standard

You only need to connect to OAuth.io API endpoints that follows the OAuth/OAuth2 standard closely, and OAuth.io hides all the complexity and peculiarities of connecting to other OAuth/OAuth2 providers.

OAuth.io has custom connectors to each different OAuth/OAuth2 providers, each of which maps the standard OAuth/OAuth2 API endpoints and their input parameters, to the appropriate OAuth/OAuth2 API endpoints on each different OAuth providers with the input parameters transformed to the format peculiar to each of their implementation.

The Definitive OAuth Tome

When you need some facts, you turn to Wikipedia. It is maintained by thousands of volunteers, making it possible to keep it updated with almost anything in this world. OAuth.io maintains Tome of OAuth, which the definitive resource of everything OAuth/OAuth2-related; it tracks deprecated OAuth/OAuth2 provider API endpoints, it provides live working code examples of all known OAuth/OAuth2 provider endpoints, which you can instantly try, tweak and then copy-and-paste for reuse on your website. Gone will be the days, where developers spend hours reading cryptic documentation, crafting code to build social logins, and then to their horror, the OAuth/OAuth2 API endpoint is deprecated or does not return the data they need.

OAuth in 10 lines of Front-End Javascript Code

You have been reading for 3+ minutes, and we have not started talking about code, so you are starting to feel agitated, and your work is calling. Well with OAuth.io, the code is less than 10 lines of front-end Javascript code, which you can conveniently cut-and-paste onto your website. Here is an example of a live working code on how to create the social login button for posting a tweet on Twitter.

1$('#twitter-button').on('click', function() {
2
3 // Initialize with your OAuth.io app public key
4 OAuth.initialize('HwAr2OtSxRgEEnO2-JnYjsuA3tc');
5
6 // Use popup for OAuth
7 OAuth.popup('twitter').then(twitter => {
8
9 //Twitter provider object
10 alert('You can check Twitter provider object in the console!');
11 console.log('twitter:', twitter);
12
13
14 // Call Twitter API endpoint that post a tweet
15 twitter.post({
16 url:"/1.1/statuses/update.json?status=Some%20random%20Tweet"
17 }).then(tweet => {
18 alert('You can find created Tweet in both console and your Twitter account!');
19 console.log('Created Tweet:', tweet);
20 });
21
22 });
23
24})

NOTE: There are some Javascript library and CSS requirements, which you can find out when you click on ‘Edit in JSFiddle’ on the website pointed to by the link.

There are hundreds more of ready-to-use Javascript code snippets ranging from importing Hotmail contacts to sharing a post on LinkedIn, etc.on Tome of OAuth. If you cannot find something that you want, you can chat with us live on OAuth.io.

Happy holidays, and have a great time growing your user base with OAuth.io!

Special thanks to Soon Hin Khor and the rest of the OAuth.io team for submitting this post for us to publish on their behalf as part of Manifold’s 12 Days of Services.

Stratus Background
StratusUpdate

Sign up for the Stratus Update newsletter

With our monthly newsletter, we’ll keep you up to date with a curated selection of the latest cloud services, projects and best practices.
Click here to read the latest issue.