# Connecting GitHub login

To let your users sign up with their GitHub accounts, you need to register your service with GitHub 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).

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

Sign in to GitHub, then follow the two steps below in order. None of this costs anything.

::step-overview

::::step{title="Register an OAuth App" id="register-oauth-app"}
When you register an app here, you get that app's Client ID and Client secret.

1. Open the developer settings screen (<https://github.com/settings/developers>).
2. In the left menu, click **OAuth Apps**.
3. Click **New OAuth app**.

   ![The OAuth Apps screen. The left menu lists GitHub Apps, OAuth Apps, and Personal access tokens, the list is empty, and the New OAuth app button is visible](/_img/en-US/manual/service-users/service-login/images/github-01-oauth-apps.webp)

4. In **Application name**, enter the name your users will see (for example, `Cozy Closet`).
5. In **Homepage URL**, enter your site's address (for example, `https://shop.example.com`).

   :::note
   If you don't have a site yet, enter the address you plan to use. You can change it later. **Application description** on the same form is optional. Whatever you enter there is shown to users exactly as written, so write it for your users to read.
   :::

6. Paste the address below into the **Redirect URI** 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": "github"
   }
   ```

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

7. Click **Register application**.

   ![The Register a new OAuth app form. Application name holds "Cozy Closet", Homepage URL holds the site address, and Redirect URI holds the WEEGLOO address](/_img/en-US/manual/service-users/service-login/images/github-02-register-form.webp)

   <!-- 캡쳐 필요(재촬영): 예시 사이트 주소를 바꿨다. 지금 캡쳐의 Homepage URL 칸에는 옛 예시 도메인이 찍혀 있으므로 https://shop.example.com 으로 다시 찍는다 / 사전 준비: GitHub의 Register a new OAuth app 폼. Application name "포근한 옷장", Homepage URL https://shop.example.com, Redirect URI 칸에 옷가게 Space "쇼핑몰"의 GitHub 리디렉션 URI. Register application은 누르지 않는다 -->
::::

::::step{title="Copy the Client ID and Client secret" id="copy-credentials"}
When you click **Register application**, the settings screen for your new app opens. The **Client ID** is already shown on this screen. You create the Client secret now by clicking a button.

1. Copy the value shown under **Client ID**.
2. Click **Generate a new client secret** to the right of the **Client secrets** heading.

   ![The app settings screen right after registration. The Client ID value is visible, and the Generate a new client secret button is to the right of the Client secrets heading](/_img/en-US/manual/service-users/service-login/images/github-03-client-id.webp)

3. Click the copy icon to the right of the new value to copy the secret.

   :::note{variant="warning" title="Once you leave this screen, you can't see the secret again"}
   The **Client ID** stays on this screen, so you can see it again anytime, but the secret doesn't. If you lose the secret, create a new one with **Generate a new client secret**, then enter the new value in WEEGLOO again. As the name suggests, the secret is confidential. Don't share it with anyone or write it down anywhere public.
   :::

   ![The screen right after the secret is created. A blue notice, the Client secret value, and its copy icon are visible](/_img/en-US/manual/service-users/service-login/images/github-04-client-secret.webp)
::::

## Login requires a public email {#public-email}

GitHub login has one requirement. The GitHub account that's logging in must have its email set to public.

When users log in with GitHub, WEEGLOO also receives the account's public email and saves it with the member. Within the same *Space*, each email address can sign up only once. Accounts with no public email set don't send this value, so sign-up or login stops there ([An email on the external account is required to sign up and log in](/manual/service-users/service-login.md#email-required)).

In that case, users see a WEEGLOO notice screen saying their email couldn't be retrieved. To have your site detect this situation and show its own guidance, see [When sign-up or login is blocked](/manual/service-users/service-login.md#when-sign-in-is-blocked).

![The WEEGLOO notice screen saying the email couldn't be retrieved. It explains why and has a Back to start button](/_img/en-US/manual/service-users/service-login/images/login-email-required.webp)

Users have to fix this themselves. When they open **Public profile** in their GitHub account settings (<https://github.com/settings/profile>), they'll find a **Public email** setting. Once they select an email to display there, their next login goes through. Accounts that haven't selected one yet show only **Select a verified email to display**.

![The GitHub profile settings screen. Public profile is selected in the left menu, and the dropdown under Public email shows Select a verified email to display](/_img/en-US/manual/service-users/service-login/images/github-05-public-email.webp)

We recommend noting this requirement on your site where users log in with GitHub, so they know about it before they get stuck.

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

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