You can allow your users to sign in with Facebook using the Facebook Service.
Follow these steps to configure Facebook to allow Anvil to communicate with it.
To connect Anvil with Facebook, you need to create an ‘app’ in Facebook for Developers. For our purposes, this is just a record held by Facebook to inform it of your Anvil app.
If you already have an app in Facebook for Developers that you want to link to Anvil, you can skip this step.
To create a new one, go to https://developers.facebook.com/ and click on ‘get started’. You’re presented with some simple setup steps, fill them in as appropriate.
After some basic setup steps, you’ll be presented with ‘Add A Product’. Add Facebook Login.
In the Facebook Login Product’s Settings, there is a box marked ‘Valid OAuth Redirect URIs’.
https://anvil.works/apps/_/facebook_auth_callback to it.
Now go to Settings->Basic. Copy the App ID and App Secret for your app.
Add the Facebook Service to your Anvil app from the Anvil Editor, and paste your App ID and App Secret into the appropriate boxes.
Add the Users Service and check the Sign In With Facebook box.
Your login form will now show a ‘Log In With Facebook’ link, which opens the Facebook login dialog when clicked.
Click this link to login with your Facebook account.
You can also use
anvil.facebook.auth.login() to present a simple login dialog for only Facebook login.
If you use
anvil.facebook.auth.login(), your users’ login details are not stored in Anvil’s Data Tables.
The Microsoft and Google services allow user management with Microsoft and Google Single-Sign-On services in a very similar way.
They also provide integration with Google and Microsoft Azure REST APIs, plus Python bindings for Google Drive and Gmail.