- Views: 6
- Report Article
- Articles
- Computers
- Programming
Integrate Facebook Authentication in ASP.Net5 Web App

Posted: Jun 19, 2015
Have you recently created a web application using Visual Studio 2015RC? Looking to integrate Facebook authentication to this web application built on ASP.Net5? Then you have hit the right keys and reached the right place. Here, you will use easy steps to integrate Facebook authentication.
Now, that the app is ready, you will first need to navigate to developers.facebook.com. Here add the new web app, you have created. You will be asked to select a platform, from the given options. While undertaking this process, you should ideally choose website as the platform.
Name the App
Once, you have chosen the platform, your next step involves giving a name to the web app. The name should be relevant to your organization, or how the app works.
Create App Id
You have given the app a name. Now, move on and choose a category that best represents your app. You can select any category from the given choices; of course relevancy matters highly in here. Once you are done with selecting the category, your next step is to create an App ID which will represent the app. You should ideally create an app secret too to go with this app Id. This will help identify your app easily. Once, your app Id and app secret have been created, you need to create a project URL.
Configure Startup.cs
Now, you need to configure the startup.cs file. In here, you will need to configure IApplicationBuilder app, IHostingEnvironment env, Iloggerfactory method as well as uncommented. You can use the code given below for this task
app.UseFacebookAuthentication();
With this, the Facebook middleware is added using the HTTP Request PipelineNow, add AppId as well as AppSecret to the config.json file"Authentication": {
"Facebook": {
"AppId": "8xxxxxxxxxx",
"AppSecret": "2xxxxxxxxxxxxxxxxxxxxxx"
}
}
With this code added, when you run the application, and reach the login screen, you will find the Facebook button added to it.When you click on this button, you will be redirected to the login page. Adding the login page for Facebook, enables users to login to the app by using their Facebook credentials.
Getting people to sign up using registration forms is difficult. Allowing people to access your website, without signing up means no leads on who accessed your site. The easiest way to tackle this situation is by allowing Facebook signup. You can easily integrate Facebook authentication to your ASP.Net5 website. Hire ASP.Net developers India to create apps that will help grow your business.
About the Author
Deepa is a technical writer with Semaphore Software.
Rate this Article
Leave a Comment
