Attention: For this process to work, you need to have the SSL certificate installed on your site. The certificate is required by companies such as Google and Facebook, and it's global standard to guarantee the connection's security. You can acquire the certificate here. 


You can allow your visitors to sign up as members or sponsors using their Facebook accounts. To enable this feature, the first thing you need to do is create an App on the Facebook Developers platform. Simply follow the steps below:

 

1. Go to https://developers.facebook.com/

2. On the top right corner, click on "Log in". If you’re already logged on to Facebook, go to step 4. 




3. Type your Facebook credentials and click on Log in.

4. On the top right corner, click on the option My Apps.



5. Click on Create App button. On the create an app page, select Other. On Select an app type, choose the Consumer option. Then, type your App Name in the field Add an app name. This could be your site name.


6. The field App contact email will be filled automatically with the main contact email from your Facebook account. You can change it if you want.


7. Click on Create app.






8. You’ll be redirected to your App Dashboard.



9. Next, click on the option Settings > Basic.



10. Take note of your App ID and App secret. You’ll need those on step 24.



11. Type the remaining information and details about your App. Do not hit Save changes before step 12.

  1. Namespace: this field is optional

  2. App Domains: type here the domain of your website.

  3. Privacy Policy URL: type here a valid address to your website privacy policy page.

  4. Terms of Service URL: type here a valid address to your website terms of use page.

  5. User data detection: type here your Contact us page URL.

  6. Upload an icon for your app: this field is optional and can be done later.



12. Click on Add Platform.



13. Select the option Website.



14. Type your site URL, including the protocol (http:// or https://). It should match the domain from step 12. 2. Then hit Save Changes.



15. On the Add a Products section, click on Add Product.



16. Click on the button Set up from the Facebook Login box.



17. On the next screen, click on the option Web.



18. Confirm your site URL, hit Save, and then Continue.



19. On the next screen, you can keep the next steps. Click on Settings.



20. On the field “Valid OAuth redirect URIs”, type the two variants of your domain URL as follows:

https://www.yourdomain.com/
sponsors/facebookauth.php
https://yourdomain.com/
sponsors/facebookauth.php


Attention: Make sure to replace "yourdomain" with your live site domain, and also add to it the bold part /sponsors/facebookauth.php


On the field  "Allowed Domains for the JavaScript SDK" type the URL of the Home page of your site, as follows:

https://www.yourdomain.com 


And enable the Login with the JavaScript SDK option


Hit Save Changes.


Note: From March 2018, Facebook started requiring that all redirect URIs be secure, i.e, to include https.



21. Now, on the Warning message at the top o the page, click on Get Advanced Access.



22. Now, it is necessary to Get advanced access to public_profile and email options. Once clicked on, Facebook will request your account password to confirm your identity.





Note:It is important to note that when requesting advanced access to email and public_profile, you may need a few attempts, since they request your Facebook account password to confirm your identity. The access will not be given after one attempt, since Facebook has an issue with this option, but in a few attempts, you will be able to get the advanced access.

Attention: Facebook has changed some of its policies, from these changes on, the Facebook login configuration will only work correctly after Facebook verifies and approve the business. So, when requesting advanced access to email and public_profile (as seen in the screenshot and instructions above), it will request your business verification, and they will require detailed information as well as documents. The business approval may take from 10 minutes to 14 days. Please, check this article from Facebook with more details: Verify your business in "Business settings" 


When clicking to get advanced access to email and public_profile, Facebook will request your business verification. Add all your business information requested by Facebook, and then wait for their approval within 14 days. 


23. Change the App Mode switch to Live.  



24. Go back to your eDirectory site manager at the Settings tabSign in options and enter the App ID and App Secret copied on step 10. Click on Save Changes.


25. After saving the page, you can test your App by clicking on Click here.


 

26. If everything is ok, you’ll be redirected to the Facebook confirmation page. Log in to your Facebook if needed, and then click on the “Continue as …” button.



27. After that, you’ll be redirected back to eDirectory site manager, a pop-up will be displayed for you to confirm the Facebook ID number and after clicking on "Use this Facebook User ID" button, the field Facebook User ID will be filled in automatically. Hit “Save Changes” again.



That’s it! Your Facebook App is created and from now on your visitors will be able to easily sign up using their Facebook account.


Attention: After configuring Facebook login, you will receive on your Facebook account, a message of a necessary data check-up for your Facebook login app. You may see this message under Alerts or Required action. The data check-up is a simple, but a very important configuration, and it is needed to be done once a year. If the account owner does not perform this configuration, Facebook may disable the app, causing the login not to function. 




Check all the boxes, click on "Continue", and submit the data checkup: 



We recommend to always check your Facebook developers account for alerts that Facebook may send, so you can keep your account up-to-date, and also keep your Facebook login configuration functioning correctly. 



Login with Facebook in the app


If your eDirectory website includes the Android mobile app, follow the additional steps below to enable Facebook login on the mobile app.


1. Access on your site, the app builder. On your site manager area, click on "Mobile app" and then on "Build your app"



2. Follow all 4 steps up to the "Build" option. 





3. Next, click on "Build & Submit". Make sure to define your application name, load the icon image. Otherwise, you will be prompted to do this before accessing the "Build" option.




4. You will be redirected to the app builder website. Click on the "Android" option.



5. Scroll down to get to the Facebook Login configuration section, and copy the fields: Google Play Package Name and Key Hashes.




6. Back to Facebook developers dashboard, click on the option Settings > Basic.   

7. Click on "Add Platform" and select "Android".


 




8. Next, select "Google play" and paste the Google Play package name on the fields "Package names" and "Class name", and paste the key hashes on the Key hashes field. Click on "Save changes".





All set! Remember that after configuring login with Facebook for Android application for the first time, it is needed to compile your app again, and resend it to Google play Store to make sure it will reflect the changes.irá as alterações.