How to generate Facebook App ID and App Secret | by Priyanka Kondajji | Medium

How to generate Facebook App ID and App Secret

Photo by William Iven on Unsplash

Facebook authentication is one of the easiest ways to allow users to login. To achieve this, we need to create an app on the Facebook platform and use the obtained APP ID and APP SECRET in our application. Login to the Facebook Developer account. On the upper right-hand side, click on the “My Apps” menu and then click Create App.

Enter app Display Name and Contact Email and click Create App ID.

Now, select Integrate Facebook Login and Confirm.

By default, the app is set in development mode and is not public yet. Select Basic under Settings. You will find the App ID and App Secret here. Next, add your domain name ex: yoursite.com to App Domains field. Since we are creating this app for development purposes, we shall add “localhost”. Add a valid Privacy Policy URL and select a Category, in case you would want to make your app Live and make your website accessible to the public.

At the bottom of the section, click on Add Platform. Select a platform based on the kind of app that you will be using.

It adds a section for Site URL. Add your site address (ex: https://yoursite.com). For local testing, let’s add “http://localhost:8000” and save.

Permissions and Features:

At this stage, your app will have permission restriction to fetch the user’s email and default fields only. You can find this under App Review — > My Permissions and Features.

Email — user’s primary email address.

Default — default fields of a user’s profile include id, first_name, last_name, middle_name, name, name_format, Picture, Short_name

Any additional details if required will need to go through the app review process. For ex: If you need the details of user location, then go to App Review — > Permissions and Features and select user_location. Click on the Request button and continue to the App Review page.

Enter the required details and Submit for Review.

After the details are verified and approved, you would have permission to get user_location.

Once you find that the app is working fine, you can turn the toggle switch ON found on the top menu bar, to get in to live mode and confirm. After confirmation, the app is set in Live mode.

Creating a Test App:

While your app is in Live mode, you can create a test app that is a clone of your production app and continue to test your app without affecting the behavior of the production app. To create a test app, select your app from the left-hand upper corner and click Create Test App.

In the popup, enter a test app name and click Create Test App. The new cloned app would have a separate APP ID and APP SECRET.

Deleting the App:

From the top menu bar on the right-hand side, click on the profile pic, then click on See All Apps.

From the app you have created, on the top right corner, click on the down arrow. You can also create a Test App from here. Click on Delete App.

It asks for confirmation before deletion. Once accepted, your app will be permanently removed and will no longer be accessible.