This article focus on how to create and set up a facebook application to make life easier for your user, they can use their facebook account to create account on your platform.
Screenshots step by step below the instruction.
Create and set up your facebook app
- Go to https://developers.facebook.com/
- Register your account as a developer and make sure you are logged in.
- Click on “My Apps” dropdown in the top right corner of the header, next to your profile picture and click Add a New App. A popup should appear.
- Type your app display name. For example: “Huan Deep Try”. Don’t forget enter email of your choice.
- You have to pass the security check before go through next step.
- Don’t mind about what you see. In the left hand, choose “Settings” -> “Basic”.
- In the App Domain, fill in all domains from which you want the facebook login to work. In my case, it is “huandoan.net”. Don’t include “www” or “http/https”.
- Display “App Secret” and store it secure. Scroll down and click “Add platform” and select web.
- In the field “Site URL” add full your domain. It mean you should input domain with http or https and www. Now save it and go to next step.
- Go to “Settings” -> “Advance”, scroll to Domain Manager. Add two domain:
– One is your site domain. (e.g: https://huandoan.net).
– Another one is URL you use for redirect after facebook login. (huandoan.net/auth/facebook).
- In the left hand, click icon + next to “Product” to add new product into your app then choose Facebook login product.
- Select Web.
- You should ignore quick start set up. In the left hand side bar, you can see new product, expands it and click settings.
- In the field ” Valid OAuth Redirect URIs” add your route will be redirect to after user logged in with their facebook account. e.g: huandoan.net/auth/facebook.
- Save it.
- Almost done, you only turn your app on and your user can login with facebook account.
Now you should be do something on your website, with URL redirect from facebook you provided above. Create new user or allow user login is count on you!