# ServiceLogin settings and rules

This page covers everything about *ServiceLogin* (the setting that lets customers sign up and log in to your service themselves): its settings, rules, limits, permissions, and the tasks you do in Content Studio. If you're new to *ServiceLogin*, start with [Service member login](/getting-started/core-concepts/service-users/service-login.md), which explains what *ServiceLogin* is, how it differs from staff accounts, and the flow up to accepting your first members. The steps for getting the two values you need from a provider (the client ID and the client secret) are on each provider's connection page ([Fields that differ by provider](#provider-fields)). The list of signed-up members (*ServiceUser*), each member's role, and account deletion are covered in [ServiceUser management rules](/manual/service-users/service-user.md). The set of permissions you give members (*ServiceUserRole*) is covered in [Member role rules](/manual/service-users/service-user-role.md).

The examples use the same online clothing store as Getting Started. The "Online Store" *Space* of the *Organization* "Cozy Closet" is set up so customers can sign up with a Google or Kakao account. The **Service name** is `Cozy Closet`, the **Contact email** is `help@shop.example.com`, and the **Default return URL** is `https://shop.example.com/auth/callback`. Newly signed-up customers get the member role "Regular Member". The store also runs a phone app, so the app address `cozycloset://login` is registered too, letting customers return to the app after they log in.

## Settings {#settings}

To open the *ServiceLogin* settings screen, expand **ServiceLogin** under **Services** in the left menu and click **Basic Settings**. Before you turn it on, the screen shows only the notice "ServiceLogin is disabled", the **Start setup** button, and the **Getting started guide** link. Once it's on, the screen has three parts.

- **Basic Info**: Where you set the service name, the contact address, the address customers return to after logging in, the role new members get, and whether new sign-ups need approval.
- **Login Providers**: Where you choose which external accounts customers can sign up with. In this document, a service that provides external accounts (such as Google or Kakao) is called a provider.
- **Disable ServiceLogin**: Where you turn off *ServiceLogin*. Turning it off deletes every signed-up member ([Turning off ServiceLogin deletes every member](#when-deleting)).

![The settings form for turning on ServiceLogin for the first time. Basic Info has the Service name "Cozy Closet" (11 / 30), the Contact email "help@shop.example.com", and the Default return URL "https://shop.example.com/auth/callback" with the description above it saying it's the page in your service where users go after signing in. Below are the Add URL button for Allowed return URLs, the Default Role field with "Regular Member" selected along with the Create Role link and a refresh button, and the unselected Sign-up approval checkbox "Block new users from signing in until an admin activates their account". Below that, Login Providers lists Google, GitHub, Facebook, GitLab, LINE, Kakao, and Naver with the end of each redirect address, and each row has a + Add button. The Cancel and Activate buttons are at the bottom](/_img/en-US/manual/service-users/images/service-login-02-settings-form.webp)

### Basic Info {#basic-settings}

| Setting | Description | Default | Constraints |
|---|---|---|---|
| **Service name** | The name of your service. When sign-up or login is blocked and customers see a notice screen, this name appears on it, depending on why they were blocked ([When sign-up or login is blocked](#when-sign-in-is-blocked)) | Empty. Required | 1 to 30 characters. You can change it later |
| **Contact email** | The address shown to customers as a contact. It appears on the same notice screens as the **Service name** | When you first turn it on, your account's email address is filled in. You can change it to another address | Must be an email address |
| **Default return URL** | The address on your site that customers return to after logging in. Every login where the site or app doesn't specify its own return address comes back here | Empty. Required | Only web addresses starting with `http://` or `https://`. Register app addresses under **Allowed return URLs** |
| **Allowed return URLs** | The list of addresses a site or app can specify as the place to return to when it starts a login. You set a **Login duration**<!-- ko: 로그인 유지 기간 / 영어 화면 표기 미확인 --> for each address | Empty | Up to 10. They aren't on the first-time setup form. You add them on the settings screen after it's on ([Return addresses and login duration](#return-address-and-session)) |
| **Default Role** | The member role (*ServiceUserRole*) applied to members by default | Not selected. Required | One of the member roles created in this *Space*. You create roles on the **Roles** screen, which the **Create Role** link opens ([Where you set the Default Role](#default-role)) |
| **Sign-up approval** | If you select **Block new users from signing in until an admin activates their account**, newly signed-up customers can't use the service until staff enable them | Not selected. Customers can use the service as soon as they sign up | Doesn't affect members who have already signed up ([Sign-up approval applies only to new sign-ups](#approval)) |

Above the **Default return URL** field is the description "The page in your service where users go after signing in." This address is different from the redirect URI you register in the provider's developer console. How the two addresses differ is explained in [The three addresses a login passes through](#three-addresses).

### Login Providers {#login-providers}

**Login Providers** lists **Google**, **GitHub**, **Facebook**, **GitLab**, **LINE**, **Kakao**, and **Naver**, one per row, in that order. A provider that isn't on shows the end of its redirect URI and a copy icon in its row, with a **+ Add** button on the right. A provider that's already connected has an **Edit** button instead of **+ Add**. A provider that's on has a green dot next to its name, and below the name, the beginning of the client ID you entered appears along with the field's name.

These are the fields involved when you turn on a provider. The field names differ by provider ([Fields that differ by provider](#provider-fields)).

| Setting | Description | Default | Constraints |
|---|---|---|---|
| Redirect URI | The address the provider uses to send the login result back to WEEGLOO. You register it in the provider's developer console | Set and shown by WEEGLOO. You can't change it | It's different for each *Space* and each provider. Copy it with the copy icon in the row or in the expanded instructions |
| Client ID | The value the provider uses to recognize your service. You get it from the provider's developer console | Empty. Required | Up to 256 characters |
| Client secret | The secret value that pairs with the client ID. You get it from the provider's developer console | Empty. Required | Up to 512 characters. You can't view it again after saving, and you enter it again every time you make changes ([You can't view a provider's secret again](#client-secret-is-write-only)) |

- At least one provider must always be on. When you first turn *ServiceLogin* on, you can't **Activate** until at least one provider is on. After it's on, you can't turn off the last remaining provider.
- You turn on each provider only once. You can't connect two apps from the same provider at the same time.

![The Google row expanded by clicking + Add on the first-time setup form. The button on the right of the row has changed to Close, and below it is the Google setup guide link. Next to 1. Register an OAuth client in Google Cloud Console is the Open Google Cloud Console link, and below it the Authorized redirect URI field shows the address WEEGLOO set, with a copy icon. 2. Enter in Weegloo has an empty Client ID field and an empty Client Secret field, and at the bottom right are Cancel and a grayed-out Add button](/_img/en-US/manual/service-users/images/service-login-03-google-credentials.webp)

![The connected Google row expanded by clicking Edit on the settings screen after ServiceLogin is on. Steps 1 and 2 are laid out the same as when you first turn it on, and the Client ID field is filled with 821047-pogeun-otjang.apps.googleusercontent.com. Above the Client Secret field is a notice saying the saved value can't be shown for security and to enter the Client Secret again, and the field shows masked dots. At the bottom left is a grayed-out Remove button, and at the bottom right are Cancel and a grayed-out Save button](/_img/en-US/manual/service-users/images/service-login-04-google-connected.webp)

### Fields that differ by provider {#provider-fields}

When you turn on a provider, step-by-step instructions expand below it. In the first step, you register the redirect URI in the provider's developer console. In the last step, **Enter in Weegloo**, you enter the two values you got. LINE and Kakao have one more step in between for receiving email addresses. The field names are as follows.

| Provider | Provider-side field for the redirect URI | Client ID field | Client secret field | How to get the values |
|---|---|---|---|---|
| Google | **Authorized redirect URI** | **Client ID** | **Client Secret** | [Connecting Google login](/manual/service-users/service-login/google.md) |
| GitHub | **Authorization callback URL (Redirect URI)** | **Client ID** | **Client Secret** | [Connecting GitHub login](/manual/service-users/service-login/github.md) |
| Facebook | **Redirect URI** | **App ID**<!-- ko: 앱 ID / 영어 화면 표기 미확인 --> | **App secret**<!-- ko: 앱 시크릿 코드 / 영어 화면 표기 미확인 --> | [Connecting Facebook login](/manual/service-users/service-login/facebook.md) |
| GitLab | **Redirect URI** | **Application ID** | **Secret** | [Connecting GitLab login](/manual/service-users/service-login/gitlab.md) |
| LINE | **Callback URL** | **Channel ID** | **Channel secret** | [Connecting LINE login](/manual/service-users/service-login/line.md) |
| Kakao | **Redirect URI** | **REST API key** | **Client Secret - Kakao Login Code** | [Connecting Kakao login](/manual/service-users/service-login/kakao.md) |
| Naver | **Callback URL** | **Client ID** | **Client Secret** | [Connecting Naver login](/manual/service-users/service-login/naver.md) |

## Rules {#rules}

### Each Space has one ServiceLogin {#one-per-space}

A *Space* has only one *ServiceLogin*. You don't create several. You turn on the one it has and edit its settings as needed.

- Each *Space* keeps its own list of signed-up members. If you run services with different customers and different content, like a clothing store and a neighborhood bakery, create a separate *Space* for each service and turn on *ServiceLogin* in that *Space*. A customer who signed up for "Online Store" isn't a member of the bakery's *Space* ([Space settings and rules](/manual/access-and-permissions/space.md)).
- Everything that uses the same *Space*'s content, such as a service's website and app, shares one *ServiceLogin*. For the website and the app to send customers back to different addresses after login, register those addresses under **Allowed return URLs** ([Return addresses and login duration](#return-address-and-session)).
- Logging in at one place doesn't log a customer in at the other. Customers log in to the website and the app separately.
- A *Market App* that includes a *ServiceLogin* can't be installed in a *Space* that already has *ServiceLogin* turned on ([What's checked before you can install](/manual/market-app/app-install.md#installability-checks)).

### You need five things to turn it on {#what-activation-needs}

When *ServiceLogin* is off, clicking **Start setup** opens the settings form. The form is first saved when you click **Activate** at the very bottom, and that's when *ServiceLogin* turns on. *ServiceLogin* turns on only when all five of the following are in place. If something is missing, clicking **Activate** doesn't save, and a notice appears in red right below the missing field. For example, if the service name is empty, "Enter a Service name." appears below the Service name field, and if no provider is on, "Add at least one Login Provider." appears below the **Login Providers** heading.

1. **Service name**
2. **Contact email**
3. **Default return URL**
4. **Default Role**
5. At least one provider turned on

- The member role you select for **Default Role** must already exist. If there isn't one, click **Create Role** to open the **Roles** screen in a new tab and create a role. Then click the refresh button next to the **Default Role** field to reload the list. You can create member roles even before you turn on *ServiceLogin*.
- On the first-time setup form, clicking the **Add** button inside an expanded provider after entering its two values only holds the values in the form. They aren't saved yet. They're saved along with everything else only when you click **Activate** at the very bottom.
- If you click **Cancel** at the very bottom, nothing you entered is saved, and the screen goes back to how it was before you turned it on.

### The three addresses a login passes through {#three-addresses}

*ServiceLogin* settings involve three kinds of addresses. Their names are similar and easy to mix up, so this section tells them apart by following, in order, the addresses a customer passes through when logging in with Google on the online store site.

1. A customer clicks the Google login button on the online store site and goes to Google's login screen.
2. Once the customer verifies who they are on Google, Google sends the customer back to WEEGLOO. The address used here is the redirect URI.
3. WEEGLOO finds the member that matches the customer, or signs the customer up as a new member, then sends them back to the store. The address used here is the **Default return URL** or an address from **Allowed return URLs** that the site specified.

::diagram[Diagram showing the addresses a customer passes through when logging in with Google. It starts on the left at the "Cozy Closet" site and app and goes to the Google login screen. Google sends the customer back to WEEGLOO through the redirect URI, an address WEEGLOO sets and you register in Google Cloud Console. WEEGLOO finds the member or signs them up, then sends the customer back. If the site didn't specify an address, the customer goes to the Default Return URL https://shop.example.com/auth/callback, and the login duration is 3 days. If the app specified a registered address, the customer goes to cozycloset://login in Allowed Return URLs, and the login duration is 30 days. You set both addresses yourself in ServiceLogin's Basic settings. If sign-up or login is blocked, the customer sees a notice screen. When it's blocked because of the member limit, a duplicate email, waiting for approval, or a blocked login, that screen also shows the Contact email help@shop.example.com as a contact]{name="service-login-diagram-three-addresses"}

| Address | Who sets it | Where it's entered |
|---|---|---|
| Redirect URI | WEEGLOO sets it. The address contains this *Space*'s ID and the provider's name, so it's different for each *Space* and each provider | The provider's developer console (Google Cloud Console, etc.) |
| **Default return URL** | You set it | **Basic Info** of *ServiceLogin* |
| **Allowed return URLs** | You set them | **Basic Info** of *ServiceLogin* |

If the redirect URI you register with the provider differs by even one character, customers get stuck on the provider's login screen and can't come back to WEEGLOO. Copy the value shown in Content Studio and paste it exactly as is. A redirect URI you used in another *Space* won't work in this *Space*.

### Return addresses and login duration {#return-address-and-session}

Where customers return after logging in is decided by the site or app that started the login.

- If the site doesn't specify a return address, customers return to the **Default return URL**.
- If the site or app specifies a return address, that address must be registered under **Allowed return URLs**, character for character. If it specifies an address that isn't registered, the login doesn't start.
- The **Default return URL** isn't automatically added to the **Allowed return URLs** list. If your site starts logins by specifying the same address as the **Default return URL** itself, register that address under **Allowed return URLs** too.
- For how a site or app's program specifies the return address, see the [API reference](/api/reference/auth-api.md).

These rules apply to the addresses you enter under **Allowed return URLs**.

- Start with the part that shows the kind of address (the scheme), such as `https://` or `cozycloset://`. You can register not only web addresses but also app addresses like `cozycloset://login`.
- You can't register addresses that start with `javascript:`, `data:`, `file:`, `blob:`, `about:`, or `vbscript:`.
- You can't register an address that contains `#`.
- You can't enter the same address twice.

**Login duration**<!-- ko: 로그인 유지 기간 / 영어 화면 표기 미확인 --> is how long customers who returned to that address can go without logging in again.

- Set it between 1 minute and 1 year, as a number and a unit (**Seconds**, **Minutes**, **Hours**, or **Days**<!-- ko: 초·분·시간·일 / 영어 화면 표기 미확인 -->). The number must be a whole number.
- If you leave it empty, it's 3 days. The field's title, "Login duration (default 3 days)"<!-- ko: 로그인 유지 기간 (기본 3일) / 영어 화면 표기 미확인 -->, shows this value too.
- For logins that return to the **Default return URL**, the login duration is 3 days, and you can't change it.
- When the duration ends, customers have to log in again. If the site or app renews the login before then, the duration starts over from the renewal.
- If you change the duration, it applies to customers who log in after the change. Customers who are already logged in keep the duration that was set when they logged in.

You can set a different duration for each address, so you can keep it short for the website and long for the app. "Online Store" set the duration for the app address `cozycloset://login` to 30 days, so app customers don't have to log in again for a month.

### How customers sign up and log in {#how-sign-up-works}

- The moment a customer first logs in with an external account, a member (*ServiceUser*) is created. There's no separate sign-up screen.
- WEEGLOO tells members apart by "which account at which provider". Logging in again with the same Google account logs in as the existing member.
- At sign-up, the email address, name, and profile photo are taken from the external account and stored in the member. What's stored, and what happens when the external account's information changes later, are covered in [Information set at sign-up](/manual/service-users/service-user.md#member-information).
- Within the same *Space*, each email address can be used to sign up only once. If a customer who signed up with Google logs in with a Kakao account that uses the same email address, it doesn't connect to the same member, and the sign-up is blocked. If the email addresses differ, they sign up as different members.
- If **Sign-up approval** is on, new members sign up in a state where they can't use the service until staff enable them ([Sign-up approval applies only to new sign-ups](#approval)).

For how to view the member list and set a separate role for each member, see [ServiceUser management rules](/manual/service-users/service-user.md).

### An email on the external account is required to sign up and log in {#email-required}

WEEGLOO gets the email address from the provider not only when a customer first signs up but every time they log in after that. The email may not come through if the customer declined to share it on the provider's consent screen, if the external account has no email address, or if the setup on the provider's side isn't finished. Without an email, a customer signing up for the first time isn't created as a member, and even an existing member's login doesn't complete. This is the same whichever provider they log in with.

When that happens, customers see a notice screen that says "We couldn't retrieve your email address". Clicking **Back to start** on that screen takes them to the **Default return URL**.

![The WEEGLOO notice screen saying the email couldn't be retrieved. Below the title "We couldn't retrieve your email address." are the explanation "Either email sharing wasn't allowed, or no email address is registered on your account. Please register or allow your email address, then try again." and the Back to start button](/_img/en-US/manual/service-users/images/login-email-required.webp)

The table below shows the range of information WEEGLOO requests from each provider at login (its scopes). To receive email addresses, you need to do some things on the provider's side in advance. They're covered in each provider's setup page, linked in the last column.

| Provider | Scopes WEEGLOO requests | Provider-side setup for receiving email |
|---|---|---|
| Google | `email`, `profile` | None needed |
| GitHub | `read:user`, `user:email` | [Login requires a public email](/manual/service-users/service-login/github.md#public-email) |
| Facebook | `email`, `public_profile` | [Add the email permission](/manual/service-users/service-login/facebook.md#add-email-scope) |
| GitLab | `read_user` | [Register an application](/manual/service-users/service-login/gitlab.md#register-application) |
| LINE | `openid`, `profile`, `email` | [Apply for email permission](/manual/service-users/service-login/line.md#request-email) |
| Kakao | `profile_nickname`, `profile_image`, `account_email` | [Switch to a Biz app](/manual/service-users/service-login/kakao.md#switch-to-biz), [Set up the consent items](/manual/service-users/service-login/kakao.md#configure-scopes) |
| Naver | `email`, `profile`, `nickname` | [Register an application](/manual/service-users/service-login/naver.md#register-application) |

With Facebook and Naver, the accounts that can log in are limited until you pass the provider's review. For what's limited and how to get reviewed, see [Connecting Facebook login](/manual/service-users/service-login/facebook.md#app-review) and [Connecting Naver login](/manual/service-users/service-login/naver.md#review).

### When sign-up or login is blocked {#when-sign-in-is-blocked}

In the following cases, the login doesn't complete even after a customer verifies who they are with the provider, and a WEEGLOO notice screen appears instead.

| Case | What happens to the customer |
|---|---|
| WEEGLOO couldn't get the external account's email address | A customer signing up for the first time isn't created as a member. Existing members can't complete their login either ([An email on the external account is required to sign up and log in](#email-required)) |
| They already signed up with the same email address through a different provider | No member is created. They need to log in with the provider they first signed up with |
| The *Organization*'s member count has reached the plan's limit | New customers can't sign up. Members who have already signed up log in as usual ([Limits](#limits)) |
| **Sign-up approval** is on, and staff haven't enabled the member yet | The member is created, but the login doesn't complete. They can log in after staff enable them |
| Staff blocked that member's login, or the member's removal is in progress | The login doesn't complete ([ServiceUser management rules](/manual/service-users/service-user.md)) |

- When customers are blocked because of the member limit, a duplicate email, waiting for approval, or a blocked login (including a removal in progress), the notice screen shows the **Contact email** as a contact, along with the **Service name**. Enter an address where customers can reach you. <!-- TODO: 화면 흐름 확인: 세 안내 화면(회원 수 한도·이메일 중복·승인 대기나 로그인 막힘)의 실제 문구와 서비스 이름·담당자 이메일이 표시되는 자리 -->
- When customers are blocked because WEEGLOO couldn't get the external account's email address, the notice screen doesn't show the **Service name** or the **Contact email** ([An email on the external account is required to sign up and log in](#email-required)).
- If the site or app started the login by specifying an address from **Allowed return URLs**, customers go back to that address instead of seeing the notice screen. The reason for the block and the **Contact email** are passed along with them, so the site or app can show its own notice. The values passed along are listed in the [API reference](/api/reference/auth-api.md).

<!-- 캡쳐 필요: 회원 수 한도에 이른 Space에 새 손님이 가입하려 할 때, 같은 이메일로 다른 제공자를 통해 이미 가입한 손님이 로그인할 때, 가입 승인을 기다리는 손님이 로그인할 때 표시되는 WEEGLOO 안내 화면 세 컷. 서비스 이름과 담당자 이메일이 보이게 / 사전 준비: 옷가게 Space "쇼핑몰", 서비스 이름 "포근한 옷장", 담당자 이메일 help@shop.example.com, Google과 카카오 연결. 이메일 중복은 Google로 가입한 손님(이름 "김민지", minji.kim@example.com)이 같은 이메일의 카카오 계정으로 로그인, 승인 대기는 가입 승인을 켠 뒤 새 Google 계정("박다희")으로 가입 -->

### Where you set the Default Role {#default-role}

- You set the **Default Role** in the **Default Role** field under **Basic Info** ([Change the Default Role](#change-the-default-role)). You can also set it with **Set as Default Role** in the ⋮ menu of a row in the **Roles** list or with the button at the top of a role's edit screen. The menu and the button work only after *ServiceLogin* is on. Before that, both appear grayed out.
- You can't delete the member role used as the **Default Role**. To delete it, first change the **Default Role** to another role ([When you delete a member role](/manual/service-users/service-user-role.md#deleting-member-roles)).

Changing the **Default Role** also affects members who have already signed up. Which role applies to which member is covered in [One role applies to each member](/manual/service-users/service-user-role.md#which-role-applies), and what to allow in a member role is covered in [Member role rules](/manual/service-users/service-user-role.md).

### Sign-up approval applies only to new sign-ups {#approval}

- If you select **Block new users from signing in until an admin activates their account**, customers who log in for the first time after that sign up as members who aren't enabled yet. They can use the service only after staff enable them on the **Users** screen ([Approving new sign-ups](/operations/service/managing-members.md#approving-new-members)).
- This setting doesn't affect members who have already signed up. Even if you clear it, members who signed up while it was on and are waiting to be enabled stay waiting. Enable those members one by one.
- Members waiting to be enabled are included in the member count too ([Limits](#limits)).

### You can't view a provider's secret again {#client-secret-is-write-only}

- A value you enter in a client secret field (**Client Secret** and the like) isn't shown again after you save it. You can view the client ID again.
- When you expand a provider that's on to edit its values, you have to enter the client secret again before you can **Save**, even if you're only changing the client ID. The note "We can't show the saved value for security" appears below the field.
- If you've lost the secret, get a new one from the provider's developer console and enter it.

### When a provider is off, no one can log in with it {#turning-off-a-provider}

- When you click **Remove** on a provider that's on, the two values entered for that provider are cleared, and logins with that provider can no longer start. Clicking it shows a confirmation window. Its title is the provider name followed by "Remove", such as "Remove Kakao". The window explains that the two saved values are deleted and your service can no longer use that provider's sign-in, and it has **Cancel** and **Remove** buttons. Clicking **Remove** in the window applies the change right away, without the **Save** in **Basic Info**, and clicking **Cancel** leaves it as is.
- Members who signed up with that provider aren't deleted and stay on the list, but they can't log in until you turn that provider back on. Logging in with another provider's account that has the same email address doesn't connect to the same member either. It's blocked ([How customers sign up and log in](#how-sign-up-works)).
- When you turn it back on, you enter both values again.
- If only one provider is on, you can't turn it off. Its **Remove** button is grayed out and can't be clicked. Turn on another provider first and then turn this one off, or turn off *ServiceLogin* itself.

### How your changes are saved {#how-changes-are-saved}

Once *ServiceLogin* is on, each part of the settings screen is saved separately.

- When you edit a value in **Basic Info**, **Cancel** and **Save** buttons appear below that part. When you haven't edited any values, the two buttons don't appear. Your edits take effect only when you click **Save**.
- In **Login Providers**, each change takes effect right away whenever you expand a provider and click **Save** or **Remove**. It has nothing to do with the **Save** for **Basic Info**.
- If another staff member saves the same *ServiceLogin* while you're editing, your save isn't applied when you click **Save** in **Basic Info** or in a provider. Instead, the **Version Conflict** window appears. The window has **Cancel**, **Discard My Changes & Reload**, and **Overwrite With My Changes** buttons. For what each button does and the steps that keep both people's edits, see [What to do when you get a conflict notice](/operations/team/editing-together.md#handling-the-conflict).
- When you turn off a provider, the **Version Conflict** window doesn't appear. If turning it off fails because it overlaps with another staff member's save, the alert "Another user is editing this ServiceLogin at the same time. We've loaded the latest state, so please try again"<!-- ko: 다른 사용자가 이 ServiceLogin을 같은 시각에 수정하고 있습니다. 최신 상태를 불러왔으니 다시 시도해 주세요. / 영어 화면 표기 미확인 --> appears. Click **Retry** in the alert to try turning off that provider again.

### Turning off ServiceLogin deletes every member {#when-deleting}

When you turn off *ServiceLogin* with **Disable ServiceLogin** in Content Studio, the *ServiceLogin* is deleted, and so is every signed-up member. What goes away with it and what stays are listed in [Deleting items such as Locale, Tag, and Script](/manual/common/deletion.md#deleting-other-items).

To turn it back on, you enter everything again from scratch: the items in [You need five things to turn it on](#what-activation-needs) and each provider's two values.

## Limits {#limits}

| Item | Limit |
|---|---|
| *ServiceLogin*s per *Space* | 1 |
| Providers you can turn on | Google, GitHub, Facebook, GitLab, LINE, Kakao, and Naver. Each provider is turned on once |
| Providers turned on | At least 1 |
| Length of the **Service name** | 1 to 30 characters |
| Length of the client ID field | 256 characters |
| Length of the client secret field | 512 characters |
| Number of **Allowed return URLs** | 10 |
| **Login duration**<!-- ko: 로그인 유지 기간 / 영어 화면 표기 미확인 --> | 1 minute to 1 year. 3 days if left empty |
| Login duration for logins that return to the **Default return URL** | 3 days |
| Members who can sign up | Varies by plan. How members are counted and what happens when you reach the limit are covered in [Limits in ServiceUser management rules](/manual/service-users/service-user.md#limits) |

## Required permissions {#permissions}

| What you want to do | Required permission |
|---|---|
| View, turn on, edit, and turn off *ServiceLogin* settings | **Manage ServiceLogin** in the role (*SpaceRole*) you have in that *Space* |

- You turn on **Manage ServiceLogin** on the **Settings** tab of the role screen. Even viewing the settings requires this permission. Without it, you can't open the **Basic Settings** screen ([Settings permissions on the Settings tab](/manual/access-and-permissions/role-and-permissions.md#permission-tab)).
- **Manage ServiceLogin** takes effect only when staff members work with their own accounts. You can't work with *ServiceLogin* using a *Space Access Token* or a *Delivery Access Token* ([Settings permissions work only for people](/manual/access-and-permissions/role-and-permissions.md#settings-are-for-people)).

The permissions for working with members are in [ServiceUser management rules](/manual/service-users/service-user.md#permissions), and the permissions for working with member roles are in [Member role rules](/manual/service-users/service-user-role.md#permissions).

## Tasks in Content Studio {#tasks}

For every task, expand **ServiceLogin** under **Services** in the left menu, then click **Basic Settings**. You can also check where this menu is in [Where the other settings in a Space are](/manual/access-and-permissions/space.md#settings-map).

![The Services section of the left menu. From the top, it has Web Hostings, ServiceLogin, Scripts, Webhooks, Schedulers, and Market Apps. ServiceLogin is expanded to show three items below it, Basic Settings, Users, and Roles, and Basic Settings is selected](/_img/en-US/manual/service-users/images/service-nav-services.webp)

### Turn on ServiceLogin {#turn-on-servicelogin}

These steps turn on *ServiceLogin* in "Online Store" and start accepting members through Google login. The first-time setup form is saved only when you fill in **Basic Info**, turn on at least one provider, and click **Activate** at the very bottom. That's when *ServiceLogin* turns on ([You need five things to turn it on](#what-activation-needs)).

Before you start, have these two things ready.

- The member role "Regular Member": The member role you'll select as the **Default Role**. Create it by following [Create a member role](/manual/service-users/service-user-role.md#create-a-member-role).
- The client ID and client secret from Google: Get them in Google Cloud Console by following [Connecting Google login](/manual/service-users/service-login/google.md#get-credentials).

1. In the left menu, click **ServiceLogin** under **Services**.
2. In the expanded menu, click **Basic Settings**. The notice "ServiceLogin is disabled" and the **Start setup** button appear.
3. Click the **Start setup** button. The settings form opens.

<!-- 캡쳐 필요(재촬영): 콘솔 1.7.30부터 페이지 머리말 오른쪽 위에 튜토리얼 버튼이 있다. 번역본 컷에는 있고 이 ko 컷에는 없다. 콘솔 변경분을 몰아 찍을 때 함께 다시 찍는다(decisions.md 27번) -->
![The Basic Settings screen before ServiceLogin is turned on. Below the title is the description "Let people sign up and sign in to your site or app with their social accounts.", and in the middle are the notice "ServiceLogin is disabled", the Start setup button, and the Getting started guide link. The ServiceLogin guide link is at the top right](/_img/en-US/manual/service-users/images/service-login-01-disabled.webp)

In the form that opens, work through [Fill in the settings form](#fill-in-the-settings-form) and [Turn on social login](#turn-on-social-login) in order. You can see what the form looks like in [Settings](#settings).

#### Fill in the settings form {#fill-in-the-settings-form}

In **Basic Info**, you set the service name and contact address, the address customers return to after logging in, and the role applied to members. What each field means, its default, and its constraints are in [Basic Info](#basic-settings).

1. In **Service name**, enter the store's name, `Cozy Closet`.
2. In **Contact email**, enter `help@shop.example.com`, the address where you'll receive customers' questions. At first, your account's email address is filled in.
3. In **Default return URL**, enter `https://shop.example.com/auth/callback`, the address on the online store site that customers return to after logging in.
4. In **Default Role**, select "Regular Member".
5. Under **Sign-up approval**, leave **Block new users from signing in until an admin activates their account** unselected. That way, customers who sign up can use the service right away.

The **Default return URL** accepts only web addresses. To send customers back to an app, like the online store's app, register the app address separately under **Allowed return URLs** after *ServiceLogin* is on ([Register the address your app returns to](#add-an-allowed-callback-url)). To let new customers use the service only after staff check them, select **Sign-up approval** ([Sign-up approval applies only to new sign-ups](#approval)).

#### Turn on social login {#turn-on-social-login}

In **Login Providers**, turn on a provider and enter the two values you got from it. Google calls these two values the client ID and the client secret. You can see what the expanded instructions look like in [Login Providers](#login-providers).

1. In **Login Providers**, click the **+ Add** button in the **Google** row. Step-by-step instructions expand below Google.
2. If you haven't registered the redirect URI in your OAuth client in Google Cloud Console yet, copy the **Authorized redirect URI** shown in **Step 1** and register it. Google uses this address to send login results back to WEEGLOO.
3. In the **Client ID** field of the **Enter in Weegloo** step, enter the client ID you got from Google.
4. In the **Client Secret** field, enter the client secret.
5. Click the **Add** button below the expanded instructions. The two values are held in the form.
6. Click the **Activate** button at the very bottom of the form.

When you click **Activate** at the very bottom, *ServiceLogin* turns on. If a green dot appears next to the **Google** name in **Login Providers**, Google login is on. Now, when the online store site starts a Google login, customers can sign up and log in with their Google accounts. If it doesn't turn on when you click **Activate** at the very bottom, check [Troubleshooting](#troubleshooting).

You turn on providers other than Google the same way. The field names for each provider and each provider's setup page are in [Fields that differ by provider](#provider-fields). You can see signed-up members in **Services** > **ServiceLogin** > **Users** ([ServiceUser management rules](/manual/service-users/service-user.md)).

### Turn on another social login {#add-a-provider}

These steps add Kakao login to "Online Store", which has been accepting customer sign-ups only through Google accounts. The steps for preparing an app on Kakao's side and getting the two values are in [Connecting Kakao login](/manual/service-users/service-login/kakao.md).

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. In **Login Providers**, click the **+ Add** button in the **Kakao** row. Step-by-step instructions expand below Kakao, and the first step shows the **Redirect URI** to register with Kakao.
3. Follow [Get the REST API key and Client Secret from Kakao](/manual/service-users/service-login/kakao.md#get-credentials) to finish the setup on Kakao's side and get the two values.
4. In the **REST API key** field of the **Enter in Weegloo** step, enter the REST API key you got from Kakao.
5. In the **Client Secret - Kakao Login Code** field, enter the client secret you got from Kakao.
6. Click the **Add** button below the expanded instructions.

![The Kakao row expanded by clicking + Add on the settings screen after ServiceLogin is on. The Close button is on the right of the row, and below it is the Kakao setup guide link. Next to 1. Register an app in Kakao is the Open Kakao Developers link, and the Redirect URI field has the address WEEGLOO set and a copy icon. 2. Set up consent items tells you to enable the scopes below in the Kakao console and lists profile_nickname, profile_image, and account_email. 3. Enter in Weegloo has an empty REST API key field and an empty Client Secret - Kakao Login Code field, and at the bottom right are Cancel and a grayed-out Add button](/_img/en-US/manual/service-users/images/service-login-05-kakao.webp)

Once you save, a green dot appears next to the **Kakao** name, and the beginning of the **REST API key** appears below it. Now customers can sign up with a Kakao account too.

### Replace a provider's secret {#replace-a-client-secret}

These steps replace the client secret with a new value after you've issued a new one in Google Cloud Console.

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. In **Login Providers**, click the **Edit** button in the **Google** row. Step-by-step instructions expand below the row.
3. In the **Client Secret** field, enter the newly issued value. The **Client ID** field already shows the current value.
4. Click **Save**.

If you delete the old value in Google Cloud Console, customers can't log in with Google until you save the new value. Once you've issued a new value, enter it right away.

### Turn off one social login {#turn-off-a-provider}

These steps turn off Kakao login in "Online Store", which has both Google and Kakao turned on. Before you turn it off, check [When a provider is off, no one can log in with it](#turning-off-a-provider). Members who signed up with Kakao can't log in until you turn it back on.

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. In **Login Providers**, click the **Edit** button in the **Kakao** row. Step-by-step instructions expand below the row.
3. Click the **Remove** button at the bottom left of the expanded instructions. The "Remove Kakao" confirmation window appears.
4. Click the **Remove** button in the confirmation window. You don't need to click **Save** in **Basic Info**.

When the Kakao row's button changes back to **+ Add**, it's off.

### Register the address your app returns to {#add-an-allowed-callback-url}

These steps register `cozycloset://login` so customers who log in from the online store's app return to the app, and set its login duration to 30 days.

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. Under **Allowed return URLs** in **Basic Info**, click the **Add URL** button. An empty row appears.
3. In the **URL** field, enter `cozycloset://login`.
4. In the number field under **Login duration (default 3 days)**<!-- ko: 로그인 유지 기간 (기본 3일) / 영어 화면 표기 미확인 -->, enter `30`. The unit is already set to **Days**<!-- ko: 일 / 영어 화면 표기 미확인 -->.
5. Click the **Save** button below **Basic Info**.

![Allowed return URLs with one row added on the settings screen after ServiceLogin is on. Below the URL and Login duration (default 3 days) columns are the URL field pogeunotjang://login, the duration field 30, the unit field Days, and a red delete icon at the end of the row, with the Add URL button below. Next come the Default Role field (Regular Member) and the Sign-up approval checkbox, and the Cancel and Save buttons are at the bottom](/_img/en-US/manual/service-users/images/service-login-06-allowed-url.webp)

Now, when the app starts a login with `cozycloset://login` as the return address, customers come back to the app after logging in. If the website also specifies its own return address, add another row for `https://shop.example.com/auth/callback` the same way ([Return addresses and login duration](#return-address-and-session)).

To remove a registered address, click the delete button at the end of its row, then click **Save**. Logins that specify a removed address no longer start.

### Change the Default Role {#change-the-default-role}

Say you've created a member role "New Member" on the **Roles** screen that can only read reviews, and you want to use it as the default role. Changing the **Default Role** also affects members who have already signed up, so check [One role applies to each member](/manual/service-users/service-user-role.md#which-role-applies) before you change it.

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. Click the **Default Role** field in **Basic Info**.
3. Select "New Member" from the list. If it isn't in the list, click the refresh button next to the field.
4. Click the **Save** button below **Basic Info**.

You get the same result by opening the menu on the "New Member" row in the role list on the **Roles** screen and clicking **Set as Default Role**.

### Turn on sign-up approval {#turn-on-approval}

Use these steps when you want new customers to use the service only after staff check them.

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. Under **Sign-up approval** in **Basic Info**, select **Block new users from signing in until an admin activates their account**.
3. Click the **Save** button below **Basic Info**.

Customers who sign up after that appear on the **Users** screen, waiting to be enabled. For the steps to enable them, see [Approving new sign-ups](/operations/service/managing-members.md#approving-new-members).

### Turn off ServiceLogin {#turn-off-servicelogin}

Turning off *ServiceLogin* deletes every signed-up member, and this can't be undone. If your service is already accepting members, decide carefully ([Turning off ServiceLogin deletes every member](#when-deleting)).

1. Open **Services** > **ServiceLogin** > **Basic Settings**.
2. At the very bottom of the screen, click the **Disable** button under **Disable ServiceLogin**. Above the button is the description "Permanently deletes this ServiceLogin and all ServiceUser data."
3. In the "Disable ServiceLogin?" confirmation window, click **Disable**. The window notes that all signed-up *ServiceUser* data will be deleted and that this can't be undone.

![The Disable ServiceLogin part at the very bottom of the settings screen after ServiceLogin is on. It has the description saying it permanently deletes this ServiceLogin and all ServiceUser data, and the red-outlined Disable button](/_img/en-US/manual/service-users/images/service-login-07-disable-section.webp)

![The Disable ServiceLogin confirmation window. Because no ServiceUser has signed up in this Space, the notice says this ServiceLogin's settings and Login Provider connections will be deleted and this can't be undone. Cancel and the red Disable button are at the bottom right](/_img/en-US/manual/service-users/images/service-login-08-disable-confirm.webp)

Once it's off, the settings screen goes back to how it was before you first turned it on.

<!-- 캡쳐 필요(재촬영): 콘솔 1.7.30부터 페이지 머리말 오른쪽 위에 튜토리얼 버튼이 있다. 번역본 컷에는 있고 이 ko 컷에는 없다. 콘솔 변경분을 몰아 찍을 때 함께 다시 찍는다(decisions.md 27번) -->
![The Basic Settings screen with ServiceLogin off. Below the title is the description "Let people sign up and sign in to your site or app with their social accounts." In the middle, below the heading "ServiceLogin is disabled", are the description "Activate ServiceLogin to enable social login (Google, etc.) on your site. Weegloo handles OAuth and sessions for you.", the Start setup button, and the Getting started guide link. The ServiceLogin guide link is at the top right](/_img/en-US/manual/service-users/images/service-login-01-disabled.webp)

## Troubleshooting {#troubleshooting}

| Problem | Cause | What to do |
|---|---|---|
| You can't open the screens in the **ServiceLogin** menu | Your role doesn't have **Manage ServiceLogin** | Ask the *Space*'s admin for **Manage ServiceLogin** |
| When you first turn it on, it doesn't turn on even when you click **Activate** at the very bottom | One of the items in [You need five things to turn it on](#what-activation-needs) is missing | Fill in first the item pointed out in red right below the missing field |
| You entered a provider's two values and clicked **Add**, but *ServiceLogin* didn't turn on | On the first-time setup form, the **Add** inside a provider only holds the values in the form. It doesn't save them | Click **Activate** at the very bottom of the form |
| The **Default Role** list is empty | This *Space* has no member roles | Create a member role from **Manage Roles**, then click the refresh button |
| You can't enter an app address in **Default return URL** | The **Default return URL** accepts only web addresses | Register app addresses under **Allowed return URLs** |
| **Allowed return URLs** won't save | The scheme is missing, the address contains `#`, the scheme isn't allowed, or the same address appears twice | Fix the address by following the message below the field ([Return addresses and login duration](#return-address-and-session)) |
| You can't click the **Add URL** button | There are already 10 **Allowed return URLs** | Remove addresses you don't use |
| **Login duration**<!-- ko: 로그인 유지 기간 / 영어 화면 표기 미확인 --> won't save | It isn't a whole number, or it's shorter than 1 minute or longer than 1 year | Enter a whole number between 1 minute and 1 year |
| Customers see an error on the provider's login screen saying the address doesn't match | The redirect URI registered with the provider differs from this *Space*'s value | Copy the **Redirect URI** value from Content Studio again and register it with the provider exactly as is |
| Logins don't start from the app or site | The return address it specified isn't registered under **Allowed return URLs**, character for character | Register that address under **Allowed return URLs** |
| Customers see "We couldn't retrieve your email address" | The customer declined to share their email, the external account has no email, or setup on the provider's side is missing | Check that provider's setup in the table in [An email on the external account is required to sign up and log in](#email-required) |
| A member is blocked when they try to log in with a different social account | They already signed up with the same email address through a different provider | Tell them to log in with the provider they first signed up with |
| New customers can't sign up, but existing members can log in | The *Organization*'s member count has reached the plan's limit | Upgrade your plan or clean up members ([Limits in ServiceUser management rules](/manual/service-users/service-user.md#limits)) |
| Newly signed-up customers can't use the service | **Sign-up approval** is on | Enable the member on the **Users** screen ([Approving new sign-ups](/operations/service/managing-members.md#approving-new-members)) |
| You turned off **Sign-up approval**, but waiting members still can't use the service | This setting doesn't affect members who have already signed up | Enable the waiting members one by one |
| After you changed the **Default Role**, what existing members can do changed too | The new **Default Role** also applies to existing members who don't have a separately assigned role ([One role applies to each member](/manual/service-users/service-user-role.md#which-role-applies)) | Separately assign the old role to members who should keep it, or change the **Default Role** back |
| You can't click a provider's **Remove** button | It's the last remaining provider | Turn on another provider first and then turn this one off, or turn off *ServiceLogin* |
| You expanded a provider, but the client secret field is empty | Secrets aren't shown again after you save them | Enter the secret again when you make changes. If you've lost it, get a new one from the provider |
| After you turned off a provider, members who signed up with it can't log in | Logins can't start with a provider that's off | Turn that provider back on and enter its two values |
| The **Version Conflict** window appears when you click **Save** | Another staff member saved the same *ServiceLogin* while you were editing | Click **Discard My Changes & Reload** to check the changed settings, then make your edits again and save ([What to do when you get a conflict notice](/operations/team/editing-together.md#handling-the-conflict)) |
| When you try to turn off a provider, an alert says another user is editing it at the same time | Turning off the provider overlapped with another staff member's save | Click **Retry** in the alert |
| You can't install a *Market App* in this *Space* | The app includes a *ServiceLogin*, and this *Space* already has one | Install it in another *Space* ([What's checked before you can install](/manual/market-app/app-install.md#installability-checks)) |
| You can't work with *ServiceLogin* using a *Space Access Token* | Tokens can't work with *Space* settings | Do it in Content Studio ([Settings permissions work only for people](/manual/access-and-permissions/role-and-permissions.md#settings-are-for-people)) |

## Related docs {#related}

- [Service member login](/getting-started/core-concepts/service-users/service-login.md): Covers, with diagrams, what *ServiceLogin* is, how staff and members differ, and the flow up to accepting your first members.
- [ServiceUser management rules](/manual/service-users/service-user.md): Covers the list of signed-up *ServiceUser*s, each member's role, blocking logins, and account deletion.
- [Member role rules](/manual/service-users/service-user-role.md): Covers what to allow in the *ServiceUserRole* you set as the **Default Role**.
- [Connecting Google login](/manual/service-users/service-login/google.md): Covers the steps for getting the two values from the provider's developer console. The setup pages for the other providers are gathered in [Fields that differ by provider](#provider-fields).
- [Managing service members](/operations/service/managing-members.md): Covers running your membership, such as approving sign-ups and blocking logins, case by case.
- [Deletion rules](/manual/common/deletion.md): Covers what goes away and what stays when you delete a *ServiceLogin*.
- [API reference](/api/reference/cma/service-login.md): Covers the technical specifications, such as request formats, that you need to create and edit a *ServiceLogin* from a program. How to add customer login to a site or app is in the [Auth API](/api/reference/auth-api.md).
