# Connecting Google login

To let your users sign up with their Google accounts, you need to register your service with Google and get a Client ID and Client secret.

This page walks you through getting the Client ID and Client secret. To enter the two values in WEEGLOO, see [Enter the Client ID and Client secret in WEEGLOO](#back-to-weegloo). To show your service name and logo on the consent screen, see [Show your service name and logo on the consent screen](#show-your-brand).

## Get the Client ID and Client secret from Google {#get-credentials}

You'll complete the four steps below in the Google Cloud Console. Make sure you're signed in to your Google account. None of this costs anything.

:::note
If you use more than one Google account, a link may open in an account you didn't mean to use. Click the profile picture at the top right of the screen to check which account it is, and switch accounts if it's the wrong one.
:::

::step-overview

::::step{title="Create a project" id="create-project"}
:::note
If you already have a project you've been using, you can use it as is instead of creating a new one. In that case, skip this step and go to [Configure the consent screen](#configure-consent).
:::

1. Open the New Project screen (<https://console.cloud.google.com/projectcreate>).
2. In **Project name**, enter a name that's easy to recognize later (for example, `Cozy Closet`).
3. Click **Create**.

   ![The New Project screen. "Cozy Closet" is entered in Project name, with the Create button below it](/_img/en-US/manual/service-users/service-login/images/google-01-project-create.webp)

4. Check that the project name shown at the top of the console is your new project.
::::

::::step{title="Configure the consent screen" id="configure-consent"}
When users log in with a Google account, Google first shows a screen asking whether they want to log in to your service. In this step, you decide what name that screen shows and where users can send questions. You only need to do this once per project.

:::note
If you've already configured this in this project, you'll see your existing settings instead of the **Get started** button. In that case, skip this step and go to [Create an OAuth client](#create-oauth-client).
:::

1. Open the **Branding** screen in **Google Auth Platform** (<https://console.cloud.google.com/auth/branding>).
2. Click **Get started**.

   ![The Branding screen in Google Auth Platform, showing the notice "Google Auth Platform not configured yet" and the Get started button](/_img/en-US/manual/service-users/service-login/images/google-02-not-configured.webp)

3. In **App name**, enter the name your users will see (for example, `Cozy Closet`).
4. In **User support email**, select the address where you want to receive questions.
5. Click **Next**.

   ![Step 1, App Information, of the project configuration. App name is "Cozy Closet", and User support email is filled in](/_img/en-US/manual/service-users/service-login/images/google-03-app-info.webp)

6. Under **Audience**, select **External**.
7. Click **Next**.

   ![Step 2, Audience, of the project configuration. Of Internal and External, External is selected](/_img/en-US/manual/service-users/service-login/images/google-04-audience-type.webp)

8. Under **Contact Information**, enter an email address.
9. In the **Finish** step, check the box to agree to Google's user data policy.
10. Click **Create**.

:::note
With **Internal**, only accounts in your own organization can use the app. To let users outside your organization log in, select **External**.
:::
::::

::::step{title="Create an OAuth client" id="create-oauth-client"}
In the client you create here, you register the address that login results return to.

1. Open the **Clients** screen in **Google Auth Platform** (<https://console.cloud.google.com/auth/clients>).
2. Click **Create client**.

   ![The Clients screen. The OAuth 2.0 Client IDs list is empty, and Create client appears above it](/_img/en-US/manual/service-users/service-login/images/google-05-clients.webp)

3. In **Application type**, select **Web application**.

   ![The Application type dropdown is open, showing six types, including Web application](/_img/en-US/manual/service-users/service-login/images/google-06-application-type.webp)

4. In **Name**, enter a name to identify this client (for example, `Cozy Closet`).
5. Leave **Authorized JavaScript origins** empty.
6. Under **Authorized redirect URIs**, click **Add URI**.
7. Paste the address below into the field that appears. 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": "google"
   }
   ```

   :::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 Google login", and you'll get the complete address.
   :::

8. Click **Create**.

   ![The form with the address entered under Authorized redirect URIs. Authorized JavaScript origins is empty](/_img/en-US/manual/service-users/service-login/images/google-07-redirect-uri.webp)

:::note
The list also includes types such as Android and iOS, but select **Web application** even when you're adding login to a mobile app. That's because login results return to a WEEGLOO web address, not to your app. **Name** is for telling clients apart on Google's screens. Your users don't see it.
:::

:::note{variant="warning" title="The address you register may not take effect right away"}
Below the form, Google notes "Note: It may take 5 minutes to a few hours for settings to take effect". Right after you register the address, the change may not have taken effect yet, so login may fail. If that happens, wait a while and try again.
:::
::::

::::step{title="Copy the Client ID and Client secret" id="copy-credentials"}
When you click **Create**, the **OAuth client created** dialog opens. The Client ID and Client secret shown in this dialog are what you enter in WEEGLOO.

:::note{variant="warning" title="Once you close the dialog, you can't see the Client secret again"}
The dialog warns, "You will no longer be able to view or download the client secret once you close this dialog". Copy the Client ID and Client secret before you close it. If you'd like to keep the values in a file, you can also click **Download JSON**.
:::

1. Click the copy icon to the right of **Client ID** to copy its value.
2. Click the copy icon to the right of **Client secret** to copy its value.
3. Once you've copied both values, click **OK**.

   ![The OAuth client created dialog, showing the Client ID, the Client secret, and a warning that you can't see the secret again](/_img/en-US/manual/service-users/service-login/images/google-08-credentials.webp)

Here's which field each value goes into in Content Studio.

| Google screen | Content Studio |
|---|---|
| **Client ID** | **Client ID** |
| **Client secret** | **Client Secret** |

As the name suggests, the Client secret is confidential. Don't share it with anyone or write it down anywhere public.
::::

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

You now have the Client ID and Client secret. 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 **Google** row.
3. In the **Enter in Weegloo** step, enter the Client ID in the **Client ID** field.
4. Enter the Client secret in the **Client Secret** 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 Client ID and Client 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.

## Show your service name and logo on the consent screen {#show-your-brand}

At first, the consent screen that appears when users log in with a Google account shows WEEGLOO's domain instead of your service name. That makes it hard for users to tell which service they're signing up for, or to tell it apart from a fake site made to look similar. When your service name and logo appear, users can sign up with confidence.

This setting is optional, and login works without it. Still, we recommend setting it up before you actually launch your service. Your name and logo appear once you pass Google's [brand verification](https://developers.google.com/identity/protocols/oauth2/production-readiness/brand-verification).

The steps below assume you've published your site with *Web Hosting* at the free address WEEGLOO provides (for example, `https://cozy-closet.weegloo.app/`). That's because Google checks that your homepage address really belongs to you, and with this address, you can prove it by uploading Google's verification file to *Web Hosting*.

::step-overview

::::step{title="Prepare a homepage and privacy policy" id="prepare-site"}
Google uses your homepage to check that the name shown on the consent screen is the name of a real service. Prepare a homepage and a privacy policy on your site.

:::note
If you've left the integration to an AI agent, ask it, "Create the homepage and privacy policy I need for Google brand verification".
:::

- **Homepage**: A page that opens without logging in, describes your service, and links to your privacy policy. Put the login button on a different page.
- **Privacy policy**: A page under the same address as your homepage that explains how you use and store the information you receive from users' Google accounts.

A terms of service page is optional.
::::

::::step{title="Verify your site in Search Console" id="verify-site"}
You prove that the homepage is yours with Google Search Console.

:::note
If you've left the integration to an AI agent, upload the file you download in step 5 below to the chat and ask, "Add this file to the site and deploy it again". The agent takes care of step 6.
:::

1. Open Search Console (<https://search.google.com/search-console>). The account you use must be an owner or editor of the Google Cloud project.
2. Click **Add website**. If you've already registered a site, click **Add property** in the property selector at the top left, then click **Add website**.
3. In the **Select property type** dialog, enter your homepage address in the **URL prefix** field (for example, `https://cozy-closet.weegloo.app/`).
4. Click **Continue** on the **URL prefix** side.
5. In the **Verify ownership** dialog, under **HTML file**, click the button showing the file name to download the file. Keep this dialog open.

   ![The Verify ownership dialog in Search Console. HTML file, the recommended verification method, is expanded, showing the button with the name of the file to download, the homepage address to upload it to, and the Verify button below](/_img/en-US/manual/service-users/service-login/images/google-10-search-console-html.webp)

6. Put the downloaded file, with its name unchanged, in your site's top-level folder and deploy the site again ([Edit and redeploy your site](/manual/deployment-and-integration/web-hosting.md#redeploy-the-site)).
7. Go back to the **Verify ownership** dialog and click **Verify**.

This step is done when **Ownership verified** appears.

:::note{variant="warning" title="Don't delete the verification file"}
Search Console periodically rechecks that this file is still there. Include it whenever you upload your site again.
:::
::::

::::step{title="Fill in the branding information" id="fill-branding"}
Tell Google about the pages you prepared, the name to show, and your logo.

1. Open the **Branding** screen in **Google Auth Platform** (<https://console.cloud.google.com/auth/branding>).
2. In **App name**, enter your service name exactly as it appears on your homepage. You can't use the name of a Google product.
3. In **App logo**, upload your service's own logo. Another brand's logo won't pass verification. The file must be a JPG, PNG, or BMP of 1MB or less, and a 120×120px square looks best.
4. In **Application home page** and **Application privacy policy link**, enter the addresses of your homepage and privacy policy. If you have terms of service, enter their address in **Application terms of service link** too.
5. In **Authorized domains**, enter `weegloo.app`.
   - If there's no entry, click **Add domain** and enter it.
   - If there's already an entry, change its value to `weegloo.app`. You may not be able to delete an existing entry, and even then, changing its value is enough.

   ![The Authorized domains section of the Branding screen. The value in the Authorized domain 1 field has been changed to the Web Hosting domain, and the Add domain button appears below it](/_img/en-US/manual/service-users/service-login/images/google-11-authorized-domain.webp)

6. Click **Save**.
::::

::::step{title="Request verification and publish" id="request-verification"}
You can request brand verification only after you publish the app. While the app is in testing, the verification button doesn't appear.

1. On the **Audience** screen, click **Publish app**.
2. In the **Push to production?** dialog, click **Confirm**.
3. On the **Branding** screen, under **Verification status**, click **Verify branding**. Verification takes up to about 5 minutes.
4. If something needs fixing, check the details with **View issues**. After you fix it, select **I have fixed the issues** to request verification again.
5. Once it passes, click **Publish branding** within 7 days.

Once you publish the branding, your service name and logo appear on the consent screen.
::::

## 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.
