# Connecting Facebook login

To let your users sign up with their Facebook accounts, you need to register your service with Facebook and get an App ID and App secret.

This page walks you through getting the App ID and App secret. To enter the two values in WEEGLOO, see [Enter the App ID and App secret in WEEGLOO](#back-to-weegloo).

## Get the App ID and App secret from Facebook {#get-credentials}

Sign in with your Facebook account, then follow the four steps below in order. None of this costs anything.

::step-overview

::::step{title="Create an app" id="create-app"}
:::note
If you already have an app you've been using and its **Use cases** screen has a Facebook Login item, you can use that app as is instead of creating a new one. In that case, skip this step and go to [Add the email permission](#add-email-scope).
:::

You'll go through five screens in order: **App details**, **Use cases**, **Business**, **Requirements**, and **Overview**.

1. Open the app list screen (<https://developers.facebook.com/apps>).
2. Click **Create App**.

   ![The Apps screen with no apps yet. The No apps yet notice and the Create App button are in the center](/_img/en-US/manual/service-users/service-login/images/facebook-01-apps-empty.webp)

3. In **App name**, enter a name that's easy to recognize later (for example, `Cozy Closet`).
4. In **App contact email**, enter the address where you want to receive questions. Facebook uses this address to contact you about this app.
5. Click **Next**.

   ![The App details step of the step-by-step setup. It has the App name and App contact email fields, with the Next button at the bottom right](/_img/en-US/manual/service-users/service-login/images/facebook-02-app-details.webp)

6. Select **Authenticate and request data from users with Facebook Login**.
7. Click **Next**.

   ![The Use cases step of the step-by-step setup. Of the six items, Authenticate and request data from users with Facebook Login is selected](/_img/en-US/manual/service-users/service-login/images/facebook-03-use-case.webp)

8. Select the **I don’t want to connect a business portfolio yet.** option. As the screen explains, you can add a business portfolio later.
9. Click **Next**.

   ![The Business step of the step-by-step setup. The I don’t want to connect a business portfolio yet. option and a notice that you have no business are visible](/_img/en-US/manual/service-users/service-login/images/facebook-04-business.webp)

10. Read the **Requirements** screen and click **Next**. There's nothing to enter.

    ![The Requirements step of the step-by-step setup. Business verification and App Review are listed under Publishing requirements](/_img/en-US/manual/service-users/service-login/images/facebook-05-requirements.webp)

11. On the last screen, **Overview**, review your choices so far and create the app.
::::

::::step{title="Add the email permission" id="add-email-scope"}
When users log in with Facebook, WEEGLOO also receives their email and saves it with the member. Within the same *Space*, each email address can sign up only once. Facebook doesn't send the email unless you add the `email` permission, so don't skip this step.

1. If the app screen isn't open, click the app you'll use for login on the app list screen (<https://developers.facebook.com/apps>).
2. In the left menu, click **Use cases**.
3. Click **Customize** on the Facebook Login item.
4. On the left, click **Permissions and features**.
5. Click **+ Add** on the `email` row.

   ![The Permissions and features list. The email row shows nothing under Status and a + Add button under Action, and the public_profile row shows Ready for testing](/_img/en-US/manual/service-users/service-login/images/facebook-06-email-missing.webp)

6. Check that **Status** shows **Ready for testing** on both the `email` and `public_profile` rows.

   ![The same list. Status is Ready for testing on both the email and public_profile rows](/_img/en-US/manual/service-users/service-login/images/facebook-07-email-added.webp)
::::

::::step{title="Register the login address" id="register-callback"}
1. If the **Customize use case** screen isn't open, click the app you'll use for login on the app list screen (<https://developers.facebook.com/apps>). Then, under **Use cases** in the left menu, click **Customize** on the Facebook Login item.
2. On the left, click **Settings**.
3. Paste the address below into the **Valid OAuth Redirect URIs** field. Select your *Space* to insert its *Space* ID into the address.

   ```weegloo-redirect-uri
   {
     "template": "https://auth.weegloo.com/v1/spaces/{spaceId}/login/oauth2/code/{provider}",
     "provider": "facebook"
   }
   ```

   :::note
   If you're not sure which *Space* is yours and you've left the integration to an AI agent, you can also ask the agent. Ask in the chat, "Tell me the redirect address to register for Facebook login", and you'll get the complete address.
   :::

   :::note
   **Redirect URI Validator**, at the top of the same screen, isn't where you register the address. It's a tool for checking an address you enter. Enter an address in **Redirect URI to check** and click **Check URI** to check that address.
   :::

4. Click **Save Changes**.

   ![The Settings screen. Redirect URI Validator is at the top, and the Valid OAuth Redirect URIs field is under Client OAuth settings below](/_img/en-US/manual/service-users/service-login/images/facebook-08-redirect-uri.webp)
::::

::::step{title="Copy the App ID and App secret" id="copy-credentials"}
The App ID and App secret are on the app's basic settings screen.

:::note
You may see a red **Currently ineligible for submission** banner at the top of this screen. It means that **App icon**, **Privacy policy URL**, and **Category** are empty. You need these three items when you submit your app for review, but not to connect login now.
:::

1. If the app screen isn't open, click the app you'll use for login on the app list screen (<https://developers.facebook.com/apps>).
2. In the left menu, click **App settings**.
3. Click **Basic**.
4. Copy the value shown under **App ID**.
5. Click **Show** to the right of **App secret**.
6. Copy the value that appears.

   ![The Basic screen under App settings. The App ID value is visible, and App secret is hidden behind dots, with a Show button to its right](/_img/en-US/manual/service-users/service-login/images/facebook-09-credentials.webp)

:::note
You can see both values on this screen again anytime. Clicking **Show** displays the **App secret** again, so you don't need to create a new one even if you leave the screen without copying it. The **App secret** is confidential, though, so don't share it with anyone or write it down anywhere public.
:::
::::

## Add people as Testers to try out login {#testers}

You don't need to wait for review to connect to WEEGLOO. Once you enter the App ID and App secret in WEEGLOO, login works right away.

However, your new app hasn't been reviewed yet, and until it is, only the account that created the app can log in. To let someone else try logging in, add them to the app as a **Tester**.

1. In the left menu, expand **App roles** and click **Roles**.
2. Click **Add People** at the top right.

   ![The App roles screen. It has the All roles, Administrators, Developers, Testers, and Analytics Users tabs, with the Add People button at the top right](/_img/en-US/manual/service-users/service-login/images/facebook-10-app-roles.webp)

3. Select **Tester**.
4. In the field below, enter the name or Facebook ID of the person to add, and click **Add**.

   ![The Add people to your app dialog. Tester is selected among Administrator, Developer, Tester, and Analytics User, with a field below for finding people](/_img/en-US/manual/service-users/service-login/images/facebook-11-add-people.webp)

:::note
The **Test users** menu right below Roles doesn't work.
:::

## Opening login to every user requires review {#app-review}

To let any user log in, not only the people you added as a **Tester**, your app must pass Facebook's review. When you're ready, expand **Review** in the left menu and open **App Review**. The `email` and `public_profile` permissions you added earlier are listed under **Not submitted**. Check that both permissions are correct, then click **Next** at the bottom right to move on to the submission process.

![The App Review screen under Review. email and public_profile are listed under Not submitted](/_img/en-US/manual/service-users/service-login/images/facebook-12-app-review.webp)

Several more steps follow after you click **Next**, but this page only goes as far as starting the submission. The rest of the process and the review criteria are in [Meta's documentation](https://developers.facebook.com/documentation/resp-plat-initiatives/appreview). Once your app passes review, any user can log in with it from then on.

## Enter the App ID and App secret in WEEGLOO {#back-to-weegloo}

You now have the App ID and App secret. Here's which field each value goes into in Content Studio.

| Facebook screen | Content Studio |
|---|---|
| **App ID** | **App ID**<!-- ko: 앱 ID / 영어 화면 표기 미확인 --> |
| **App secret** | **App secret**<!-- ko: 앱 시크릿 코드 / 영어 화면 표기 미확인 --> |

What you do next depends on how you've been working so far.

If you've been setting things up yourself in Content Studio, follow these steps.

1. Go back to [Turn on social login](/manual/service-users/service-login.md#turn-on-social-login).
2. In **Login Providers**, click the **Enable** button on the **Facebook** row.
3. In the **Enter in Weegloo** step, enter the App ID in the **App ID**<!-- ko: 앱 ID / 영어 화면 표기 미확인 --> field.
4. Enter the App secret in the **App secret**<!-- ko: 앱 시크릿 코드 / 영어 화면 표기 미확인 --> field.
5. Click the **Save** button below the expanded instructions.
6. If you're turning on *ServiceLogin* for the first time, also click the **Save** button at the very bottom of the form. Clicking this button is what saves your values and turns on *ServiceLogin*.

If you're adding a provider to a *ServiceLogin* that's already on, you only need to click **Save** below the expanded instructions ([Turn on another social login](/manual/service-users/service-login.md#add-a-provider)).

If you've left the integration to an AI agent and it asked you to get the App ID and App secret, paste both values into the chat as they are and carry on with what you were doing. The agent handles the rest of the setup from there.

## What to do next {#what-to-do-next}

- [Turn on ServiceLogin](/manual/service-users/service-login.md#turn-on-servicelogin): Covers the steps for entering these values in Content Studio and finishing the rest of the member login setup.
- [Service member login](/getting-started/core-concepts/service-users/service-login.md): Covers, with diagrams, what member login is and the flow up to accepting your first members.
- [Create a member role](/manual/service-users/service-user-role.md#create-a-member-role): Covers creating the *ServiceUserRole* that decides what signed-up members can read and write.
- [Auth API](/api/reference/auth-api.md): Covers technical specs, such as request formats, that you need to add login to your site's code.
