# 사용자 이름을 사용자의 이름(First Name)으로 제한

**URL:** https://meta.discourse.org/t/restrict-username-to-user-first-name/297604
**Category:** Support
**Created:** [3월 2, 2024, 1:29오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604 "2024-03-02T13:29:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Celso\_Teixeira](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/celso_teixeira/32/355969_2.png) [@Celso\_Teixeira](https://meta.discourse.org/u/Celso_Teixeira)
#### Post date: [3월 2, 2024, 1:29오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/1 "2024-03-02T13:29:49Z")

</div>

사용자가 OpenID로 포럼에 가입하면 이메일과 사용자 이름이 자동으로 입력되고 검증됩니다. 선택한 사용자 이름이 이미 사용 중이라면, Discourse는 이름을 고유하게 만들기 위해 숫자를 추가합니다. 사용자 이름은 사용자의 이름(name)을 기반으로 선택됩니다.

문제는 사용자 이름을 전체 이름이 아닌 이름(first name)만 사용하고 싶다는 것입니다. 가입 과정에서 사용자 이름을 변경하는 방법을 시도해 보았지만 아직 성공적인 방법을 찾지 못했습니다. 이 문제를 해결하는 방법에 대한 제안이 있다면 알려 주시면 감사하겠습니다.

 ![Screenshot from 2024-03-02 13-17-21](https://global.discourse-cdn.com/meta/original/4X/f/a/c/fac1221f77707176de1e368aaed66eba5baa5e5a.png)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [3월 2, 2024, 3:44오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/2 "2024-03-02T15:44:34Z")

</div>

이미 이 글을 올린 것 같은데요

> [@사용자 이름(First name)을 사용자 이름(User name)으로 표시하는 방법](https://meta.discourse.org/t/how-to-display-user-first-name-as-username/296769/):
>
> I prefer the username to consist of the user’s first name rather than their full name. Upon the user’s initial login, I would like the system to automatically set the username using only the first name. E.G Full name: Maria Jose → username: Maria So instead of the username be Maria\_Jose, and want it to be Maria How I can accomplish that?

---

<div class="post-metadata">

### Author: ![Celso\_Teixeira](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/celso_teixeira/32/355969_2.png) [@Celso\_Teixeira](https://meta.discourse.org/u/Celso_Teixeira)
#### Post date: [3월 2, 2024, 3:52오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/3 "2024-03-02T15:52:18Z")

</div>

이제 내가 달성하려는 목표와 직면한 문제들이 더 명확해졌습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [3월 2, 2024, 5:58오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/4 "2024-03-02T17:58:20Z")

</div>

openID 서버를 직접 관리하고 있다면, Discourse로 원하는 값을 전송하도록 설정할 수 있습니다.

다음 정보가 도움이 될 수 있습니다:

> [@OIDC를 구성하여 사용자 이름을 이메일 계정 이름 또는 인증 제공자에서 반환되는 사용자 이름과 같은 값으로 설정하는 방법?](https://meta.discourse.org/t/how-to-configure-the-oidc-to-set-the-username-as-the-email-account-name-or-a-username-like-value-returned-from-my-auth-providers/268438/2?u=pfaffman):
>
> The Discourse OIDC plugin will use the ‘nickname’ claim provided by the identity provider. So you’ll need to review the documentation for your identity provider and work out how to make it send the ‘nickname’ value that you’d like.

preferred\_nickname 필드에 원하는 사용자 이름을 채워 넣을 수 있는 것으로 보입니다. 해당 필드에 현재 어떤 값을 전송하고 있나요? 값이 비어 있거나 사용자의 전체 이름이 들어 있다면, 이것부터 변경하는 것이 좋습니다.

> <https://github.com/discourse/discourse-openid-connect/blob/3af9b35c51123b82958c4d95cfcc83527408cedb/lib/omniauth_open_id_connect.rb#L204%23L204>

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3월 2, 2024, 7:14오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/5 "2024-03-02T19:14:40Z")

</div>

이 컴포넌트를 사용해 볼 수도 있습니다. 이 컴포넌트는 현재 컨텍스트에서 원하는 동작을 수행해야 합니다.

이름 필드를 기반으로 값을 생성하여 사용자 이름 필드를 숨깁니다. 이때 첫 이름만 추출합니다.

다음 설정이 활성화되어 있어야 합니다:

- `full_name_required`
- `prioritize_username_in_ux`

> **[GitHub - Arkshine/discourse-display-first-name-only](https://github.com/Arkshine/discourse-display-first-name-only)**
>
> Contribute to Arkshine/discourse-display-first-name-only development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [4월 1, 2024, 7:15오후 UTC](https://meta.discourse.org/t/restrict-username-to-user-first-name/297604/6 "2024-04-01T19:15:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
