# Connecting LINE Login

To let shoppers sign up with a LINE account, you first register your service with LINE and receive two values. They are the Channel ID and the Channel secret.

This page covers the order in which you receive those two values. Putting the values you received into WEEGLOO is covered in [Putting the values you received into WEEGLOO](#back-to-weegloo).

## The address to copy first {#redirect-uri}

When a shopper finishes logging in at LINE, LINE sends the result back to a set address. You have to register this address with LINE, so copy it first. You paste it in step 3.

Pick your *Space* below and you get the address with the identifier filled in.

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

:::note
If you would rather fill it in yourself, put the identifier of your *Space* in the `{spaceId}` slot. Open that *Space* in the content studio and look at the browser address bar. The value that comes after `/spaces/` is the identifier.

This address is not your site's address. It is where WEEGLOO receives the login result. So it is settled now even if you have not built your site yet. If you turned on **LINE** in the content studio, the same address appears in **Step 1**, so you can copy it from there.
:::

## Getting the two values from LINE {#get-credentials}

Sign in to the LINE Developers console (<https://developers.line.biz/console/>) with your LINE account, then work through the four steps below in order.

::::step{title="Creating a provider"}
1. Click **Create a new provider**.

   ![The first screen of the LINE Developers console. No provider exists yet and the Create a new provider button is visible](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-01-console-home.webp)

2. In **Provider name**, enter the name of your shop or company (for example, `Cozy Closet`).
3. Click **Create**.

   ![The window for creating a provider. The Provider name box holds the shop name, with Cancel and Create buttons below it](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-02-provider-modal.webp)
::::

::::step{title="Creating a LINE Login channel"}
1. Under the channel kinds, click **Create a LINE Login channel**.

   ![The screen for choosing a channel kind. Four cards are visible: LINE Login, Messaging API, Blockchain Service, and LINE MINI App](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-03-channel-kinds.webp)

2. In **Region to provide the service**, choose the region where you will provide the service.
3. In **Company or owner's country or region**, choose where the business or the owner is based.
4. In **Channel name**, enter the name shoppers will see. Keep it within 20 characters.

   ![The channel creation form. Region to provide the service lists four regions, and below it the Company or owner's country or region dropdown and the Channel name box are visible](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-04-channel-form.webp)

5. Fill in the rest of the required items on the form: **Channel description**, **Web app** under **App types**, **Email address**, and the terms agreement checkboxes.

   ![The App types area. The Web app and Mobile app choices and the Require two-factor authentication toggle are visible](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-05-app-types.webp)

6. Click **Create**.

:::note{variant="warning" title="You cannot change the region after the channel is created"}
**Region to provide the service** offers only four choices, **Japan**, **Thailand**, **Taiwan**, and **Indonesia**, and you cannot change this after the channel is created.
:::

:::note
**Require two-factor authentication** is on by default. So the first time a shopper logs in, they confirm a verification code in the LINE app on their smartphone.
:::
::::

::::step{title="Registering the callback address"}
1. Click the channel's **LINE Login** tab.
2. Click **Edit** next to **Callback URL**.
3. Paste the address you copied in [The address to copy first](#redirect-uri) into the box.
4. Click **Update**.

   ![The channel's LINE Login tab. Use LINE Login in your web app is on, the Callback URL box holds the WEEGLOO address, and the Update and Cancel buttons are below it](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-06-callback.webp)

:::note
The only thing to enter here is the single address you copied above. Do not add more boxes.
:::
::::

::::step{title="Copying the Channel ID and the Channel secret"}
The two values are in the channel's **Basic settings**.

1. Click the channel's **Basic settings** tab.
2. Copy the value written in **Channel ID**.

   ![The Channel ID on the Basic settings tab. A copy icon sits next to the value](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-07-channel-id.webp)

3. Copy the value written in **Channel secret**.

   ![The Channel secret on the Basic settings tab. The value is shown as is, with a copy icon and an Issue button next to it](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-08-channel-secret.webp)

:::note
The secret is a secret value. Do not tell it to anyone, and do not write it down anywhere public.
:::
::::

## Login works only after the email permission is approved {#email-permission}

Creating a channel is not enough for LINE to hand over the shopper's email. You have to apply for the email permission separately and get it approved.

WEEGLOO tells signed-up members apart by email. So when a shopper logs in with LINE, it reads that account's email from LINE at the same time. If this value does not come over, sign-up stops right there. Every login stops this way until the permission is approved.

When it stops, the shopper sees a notice screen that WEEGLOO shows. It says in the shopper's own language that the email could not be retrieved and what to do about it, and it carries a button that goes back to your site.

![The WEEGLOO notice screen saying the email could not be retrieved. It explains the reason and carries a Back to start button](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/login-email-required.webp)

The login result never reaches your site in this case. So your site's code can neither notice this situation nor handle it on the shopper's behalf.

The person who applies is not the shopper. It is you, the one who created the channel.

1. In **OpenID Connect** at the bottom of the **Basic settings** tab, click **Apply** next to **Email address permission**.
2. Submit the materials the application screen asks for and agree to the terms.

![The OpenID Connect section at the bottom of the Basic settings tab. Email address permission is in the Unapplied state with an Apply button next to it](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/line-09-email-permission.webp)

Once it is approved, the label in the same place changes to **Applied**.

Even after the approval, a shopper who does not agree to provide their email cannot log in. What you can do on your site is write this condition where shoppers log in with LINE, so they learn about it before they get stuck.

The materials the application needs are in the [LINE docs](https://developers.line.biz/en/docs/line-login/integrate-line-login/).

## Putting the values you received into WEEGLOO {#back-to-weegloo}

Now you have the two values in hand. From here the path splits depending on how you have been working so far.

If you were configuring this directly in the content studio, follow these steps.

1. Go back to turning on social login in [Service Member Login](/getting-started/core-concepts/service-users/service-login.md#turning-on-social-login).
2. Turn on **LINE**.
3. Enter the Channel ID in the **Channel ID** box in **Step 2**.
4. Enter the Channel secret in the **Channel secret** box.
5. Click **Save**.

If you handed the integration to an AI agent and were told to go and get the values, paste the two values you received into the chat as they are and carry on with what you were doing. The agent handles the rest of the configuration from there.

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

- [Service Member Login](/getting-started/core-concepts/service-users/service-login.md): put the values you received into the content studio and finish the rest of the member login configuration.
- [Member Roles and Permissions](/getting-started/core-concepts/service-users/service-user-role.md): create the *ServiceUserRole* that decides what a signed-up member can see and use.
- [Auth API](/api/reference/auth-api.md): covers technical specifications such as the request format you need when wiring login into your own site's code.
