Saltar al contenido principal

Add Facebook as an OAuth provider

This guide explains how to let users sign in to Casdoor with their Facebook account.


Learning outcomes​

  • Create a Facebook app with Facebook Login.
  • Add Facebook as an OAuth provider in Casdoor.

What you need​


Create a Facebook app​

  1. On Meta for Developers, create an app and select its type, for example Consumer.

    App type selection

  2. Enter the name and the contact email. The dashboard of the app opens.

    Dashboard of the app

  3. Set up Facebook Login and select the Web platform.

    Facebook Login product

    Web platform

  4. Go to Facebook Login > Settings and add the callback URL of Casdoor, https://<your-casdoor-host>/callback, to Valid OAuth Redirect URIs. See Redirect URL and callback URL.

    Valid OAuth Redirect URIs

  5. In the top bar of the dashboard, switch the app from In development to Live.

    Mode switch in the top bar

  6. Go to Settings > Basic and copy the App ID and the App Secret.

    App ID and App Secret

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to OAuth and Type to Facebook.

  3. Enter the App ID as the Client ID and the App Secret as the Client secret.

    Facebook provider in Casdoor

  4. Save the provider.

Next steps​

Add the provider to an application. See Add providers to an application.

See also​