Skip to content

Facebook Integration

Ingo edited this page Apr 18, 2021 · 11 revisions

To Enable Facebook Single Sign On Integration in YAF.NET (3.0.0.0 or higher is required)...

  • You need to Enable Enable Single Sign On in the Host Settings of your Forum.
  • And you need an Facebook Application for your website.

Register your Website on Facebook.com

Everything you need to know can be found on the Facebook Developer Portal (Of Course you need an Facebook Account)

  1. Go to Facebook for Developers dashboard
  2. Click My Apps and select your App from the dropdown (If you haven't already created any app select Add a New App to create a new app)
  3. Go to App Setting > Basic Tab -> Contact Email (Fill the email id you want your app to sync with) and then click Add Platform at bottom section,
  4. Select Website and the add the website to log in as the Site URL(e.g. mywebsite.com)
  5. Then you can add App Domains which I set to our website's base domain (e.g. for a URL like http://www.mycoolwebsite.com, just use mycoolwebsite.com). If you are testing in local, you can even just give the localhost URL of your app. eg. http://localhost:8080/myfbsampleapp
  6. At the bottom right - click Save Changes
  7. Make sure you have the app ID copied and pasted correctly into your code. (The ID is in the first box on that page if you need it again.)
  8. Goto Settings -> Advanced -> see OAuth Settings area and set Valid OAuth redirect URIs = http://localhost/ , Try doing the following stuff and check if it works out.
  9. Enable Embedded browser OAuth Login option
  10. Goto Status & Review -> Status -> Enable options as yes (Make your app visible to public)
  11. The App ID/App Secret needs to be entered in the app.config in your Forum

<add key="YAF.FacebookAPIKey" value="XXXX" />

<add key="YAF.FacebookSecretKey" value="XXXX" />

When Everything is setup correctly a "Login with Facebook" Button should occur on the login page.

Login for Users

  • Users are able to Register/Login with Facebook