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
- A Meta for Developers account
- Administrator access to the Casdoor admin console
Create a Facebook app
-
On Meta for Developers, create an app and select its type, for example Consumer.

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

-
Set up Facebook Login and select the Web platform.


-
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.
-
In the top bar of the dashboard, switch the app from In development to Live.

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

Add the provider in Casdoor
-
In the Casdoor admin console, go to Identity > Providers and add a provider.
-
Set Category to
OAuthand Type toFacebook. -
Enter the App ID as the Client ID and the App Secret as the Client secret.

-
Save the provider.
Next steps
Add the provider to an application. See Add providers to an application.