How to add Facebook login to WSO2 Identity Server
Oct 9, 2020 06:52 · 393 words · 2 minute read
Hey, everyone! This is Thivi from WSO2 And today we will be looking at how to add Facebook login to WSO2 Identity Server. First, go to developers.facebook.com and on the top right-hand corner, click on My Apps. Then, click on Create App Select Manage Business Integration Give a name to your application And then, choose Yourself or your own business and click on Create App ID. Then, go through the security check and confirm that you’re not a robot. Then, under settings, select Basic and copy the App ID and store it safely somewhere because we will be needing it later.
00:43 - Then, copy the App Secret and store it safely as well. Then, add the domain name of your server under App Domains My server is running locally so let me add localhost and save changes. Once that’s done, open Identity Server’s carbon console and login with your admin credentials. Then, click on Add under Identity Providers and give a name to your Identity Provider. I am going to use Facebook here. Then, under Federated Authenticators, expand Facebook Configuration, Enable Facebook Authentication and paste the App Id into Client Id and App Secret into Client Secret and register the Identity Provider Now, that we have added Facebook as an Identity Provider to our Identity Server, let’s move onto our next step.
01:32 - In the next step, we will be adding Facebook to the authentication step. Click on List under Service Providers and click on Edit against your Service Provider. Then, under Local & Outbound Authentication Configuration, select Advanced Configuration. Then, Add Authentication Step and select basic as the Local Authenticator and Facebook as the Federated Authenticator. Click on Update. And update the Service Provider as well. This completes the configuration and we have now added Facebook as an authenitcation step. Now, let’s test our configuration.
02:08 - This is my sample SPA application and click on Si gn In Now, you will be taken to WSO2 Identity Server’s single sign-on page and as you can see now, you get the Sign In with Facebook option. Let me click on it. And I am taken to Facebook’s login page and let me login with my credentials. And then, select Approve Always and click on Continue. And here we go! We have logged in to our application through our Facebook account. .