UPDATE (24. Juli 2017):
This article was published when Angular 2 was still unstable. Since then, the Angular team published two major (breaking) releases. Struggling with limited time and resources, we are not able to provide support for angular 2 and the contents of this blog post. We also deprecated our Platform V1 to be able to focus on the release of a stable Version 2 where we focus on a better user and tenant management. If you are interested in receiving news of our platform V2, feel free to subscribe to our newsletter at Selfbits.io.

Create your Angular 2 Dashboard - Part 3: Facebook Authentication

This part will cover social (Facebook) authentication using Selfbits.

Complete Content

Part 3: Facebook Authentication

To optimize user experience, you GOT to provide social auth capabilities to your users. Instead of undergoing the burdensome OAuth process, maybe providers have developed libraries to make things easier for us.
So does Selfbits and we’ll explore how by adding a facebook signup to our login page.

We’ll be using Selfbit’s SDK from the start this time. However for those who are interested I’ll explain later what exactly the SDK is actually doing later!

Step 2: Setting up Facebook Auth on Selfbits

It should display a modal asking for Client Id and Client Secret. Sound familiar?
Close the modal for now, go to settings and note down your Selfbits app suddomain (or copy it from your APPCONFIG BASE_URL).

Wait for the app to compile and try clicking on the facebook button on the login page!

Congrats! You’ve just added a facebook sign in to your app! Try to repeat the process with another social provider like google+! The process is similar to facebook, check the official docs from Selfbits

Summary

In this article we’ve connected our dashboard to a user management system from Selfbits and enabled end users to sign up and login with their facebook accounts. There are a couple more methods the SDK offers, which you can look up here.