Facebook login error

Has anyone been able to set up the Facebook login User service? I get the following error when I click on “Sign up with Facebook”:

“URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.”

My URL is: https://playdatewiz.com/

Hi @stephen.le. We definitely need to document this better! You’ve prompted me to write a step-by-step guide to setting up your Facebook App to allow Anvil login, which I’ll add to the reference docs.

It sounds as if you need to do step 3. Could you make sure you’ve done all the steps and let me know whether the problem still occurs?


Setting up Facebook Login

  1. Create an App in Facebook for Developers, if you haven’t already: go to https://developers.facebook.com/ and click on ‘get started’.

  2. After some basic setup steps, you’ll be presented with ‘Add A Product’. Add Facebook Login.
    image

  3. In the Facebook Login Product’s Settings, there is a box marked ‘Valid OAuth Redirect URIs’. Add https://anvil.works/apps/_/facebook_auth_callback to it.

  4. Now go to Settings->Basic. Copy the App ID and App Secret for your app.

  5. Add the Facebook Service to your Anvil app from the Anvil Editor, and paste your App ID and App Secret into the appropriate boxes.

  6. Add the Users Service and check the Sign In With Facebook box.

  7. Your login form will now show a ‘Log In With Facebook’ link, which opens the Facebook login dialog when clicked.
    14

3 Likes

Thanks, Shaun, your Step 3 solved my problem!