With the growing popularity of social networks, more and more mobile apps offer you the ability to login with your social account. Clients love it because of the simplicity if offers. As a developer this is a feature you expect from your BaaS vendor instead of crafting your own user management system.


Today, we are announcing this feature as part of our Backend as a Service offering – Icenium Everlive. Now you have the ability to sign-up new users for your apps using their social accounts for Facebook, Google and Live ID. This is the easiest way to authenticate new users without requiring them to register in Icenium Everlive’s own user management system.



Setting up external identity providers with your app

Here are the steps to enable authentication with external identity providers for your app.

1) Register your application in Facebook / Google / LiveID. In the registration process you have to specify redirect_uri. This is required by OAuth 2.0 specification in order to get the users access token from the provider.

2) Go to Everlive's Backend portal, open your Everlive project, and navigate to the Project Settings section. Use the new tab “User authentication” to enable the providers you want.

3) In your app you have to get an access token from the respective provider. There are plenty of options to obtain access token from external identity providers such as Facebook or Google, but we have included one for your convenience in the sample projects below.

4) After obtaining the access token you can use any of our SDKs to invoke a method for logging with a social account. In this example we are using Everlive JavaScript SDK and Facebook to sign-up and authenticate a new user to Everlive:

 
var accessToken = {{Facebook access token}};
Everlive.$.Users.loginWithFacebook(accessToken,
    function (data) {
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    }
);

 

And you are done. Now your users can log in with their existing Facebook, Google or Live ID accounts and avoid the hassle of a new registration.

Managing social profiles in the Everlive portal 

The information from the social profile is stored in the user profile. You can see it in the field “Idenitity” part of each user. This field is keeping all of the information we have retrieved for the users along with their display names and actual emails. Note that Everlive automatically marks all users from social providers as verified by setting the IsVerified field to true.

Linking social accounts to existing Everlive users

Everlive also supports linking of existing users to their social accounts. In this way you can link as many social profiles as you want to an existing user of Everlive. To do this you need gain an access token from the provider and the id of the user in Everlive. Here is how easy it is to link an existing Everlive client to a Facebook account:

var userId = {{UserId}};
var accessToken = {{Facebook access token}};
Everlive.$.Users.linkWithFacebook(userId, accessToken,
    function (data) {
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    }
);

Sample app for retrieving tokens and authenticating with Everlive

Here is a hybrid sample app that we have prepared which shows you how to implement the logic for getting the access token from each of the providers we support. Make sure to replace your API Key in the /js/index.js file on line 43 before running the sample in Icenium.

Download a simple app that showcases the new feature.

Everlive "Friends" app with Facebook authentication

Here is a fully fledged social app called "Friends" that supports authentication with Facebook and Everlive. Make sure to replace your API Key in the /scripts/app/main.js file on line 39 before running the sample in Icenium.

Download our sample "Friends" app with Facebook support which demonstrates a real app

This feature is available for use immediately. Visit the Everlive portal to explore it, and stay tuned for more exciting updates in the upcoming weeks!


About the Author

Hristo Borisov

Hristo Borisov (@hristoborisov) is currently a product line manager in Telerik leading all cloud technologies part of the Telerik Platform after spending more than 6 years with the company. A passionate advocate of applying lean startup practices to existing organizations, Hristo is on the quest for discovering scalable and sustainable business models through product and customer development using tools like MVPs, Pivots, and Lean Business Model Canvases.

Related Posts

Comments

Comments are disabled in preview mode.