In this article I will explain with an example, how to create FaceBook App and get FaceBook Application Id and Secret key.
 
Creating a new FaceBook Application
In order to create Facebook App follow the below steps.
1. First you need to visit Facebook Developers app using the following URL.
2. Then, Login with your Facebook account. If you don't have a Facebook account, use the Sign up for Facebook link on the login page to create one.
3. After Login, click on Create App button.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
4. Now, select the Authenticate and request data from users with Facebook Login RadioButton and click on Next.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
5. Next, select the No,I’am not building a game option if you are not building a game as Login type and click on Next.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
6. Next, in the App details section fill the following details.
Add an app name – Name of your app.
App contact email – The Email address.
Business Account – It is optional. Here it is set as No Business Manager account selected from the DropDownList and click on Create app.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
7. Now the App is ready and display as shown below.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
 
Retrieving the Application Id and Secret
After successfully created the Application, expand the App Settings and click on Basic option from there.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
You can now see your App ID and App secret by clicking in the Show button. You can note down the App ID and App secret for further use.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
 
Configuring the Website with FaceBook Login
For configuring website with FaceBook Login, you need to click on Set up button in the FaceBook Login option in the Dashboard.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
The click on the Settings in the Facebook Login section.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
Now, fill the TextBox with URL in the Valid OAuth Redirect URIs section of your application page that will use FaceBook API.
 
Note: When you deploy your site to domain server, then make sure you update Website with FaceBook Login with the new URL otherwise the App won’t work.
 
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
 
Finally, click on Save changes.
 
 
Possible Errors and their solutions
Error validating application. Invalid application ID.
Following error occurs, when you have set incorrect or invalid App Id.
Hence, you need to make sure you have specified correct App Id of a valid FaceBook App.
{
   "error": {
      "message": "Error validating application. Invalid application ID.",
      "type": "OAuthException",
      "code": 101
   }
}
 
Invalid redirect_uri: Given URL is not allowed by the Application configuration.
Following error occurs, when Valid OAuth Redirect URIs has URL that does not match with the URL of the page that’s making call to the FaceBook App.
Hence, you need to make sure that this field must always be set to the URL of the page that makes call to the FaceBook App.
{
   "error": {
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
      "type": "OAuthException",
      "code": 191
}