# Username

Key: `identity.person.username`

Online username or handle for a user account. Typically alphanumeric with underscores, hyphens, or dots. Case-insensitive storage. Locale-specific due to character set restrictions. Following useradd(8), a name may end with a dollar sign and may be up to 256 characters long.

Page: <https://meridian.online/docs/projects/finetype/types/identity/person/username>

Samples: `john.smith`, `user_123`, `alice-wonderland`, `bob.jones_42`

## Background

### Origin

Other terms for a username include login name, screen name, account name, nickname and handle.[[1]](https://en.wikipedia.org/wiki/User_%28computing%29) POSIX defines a user name as a string that is used to identify a user.[[2]](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html) To be portable across POSIX systems, a user name is composed of characters from the portable filename character set.[[2]](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html) That set is the upper- and lower-case letters A to Z, the digits 0 to 9, and the period, underscore and hyphen-minus.[[2]](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html) POSIX advises that the hyphen-minus should not be used as the first character of a portable user name.[[2]](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html)

For internationalised usernames, the IETF published RFC 8265 in October 2017.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html) RFC 8265 obsoletes RFC 7613.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html) RFC 8265 defines two profiles, UsernameCaseMapped and UsernameCasePreserved.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html) The UsernameCaseMapped profile maps uppercase and titlecase code points to their lowercase equivalents.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html) RFC 8265 suggests that it is generally preferable to apply the UsernameCaseMapped profile.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html) Under RFC 8265, a username can be a space-separated sequence of userparts, though no single userpart may contain a space.[[3]](https://www.rfc-editor.org/rfc/rfc8265.html)

### Use

On Linux, the useradd manual says usernames may contain only lower and upper case letters, digits, underscores or dashes.[[4]](https://man7.org/linux/man-pages/man8/useradd.8.html) Length and character rules differ from one system to the next, so treat any fixed pattern as a description of a particular source rather than of usernames in general. (Meridian's view) Compare usernames after case-folding when the source system treats them case-insensitively, but keep the original spelling for display. (Meridian's view) A purely numeric value in a username column deserves a second look, since it may be a user ID that has been put in the wrong field. (Meridian's view)

### Where you'll meet it

GitHub says usernames for user accounts on GitHub can only contain alphanumeric characters and dashes.[[5]](https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication) When GitHub builds a username from an external identity provider, it converts other non-alphanumeric characters to dashes, so mona.the.octocat becomes mona-the-octocat.[[5]](https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication)

## Sources

1. [User (computing)](https://en.wikipedia.org/wiki/User_%28computing%29) — secondary source
2. [Definitions](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html) — standard
3. [RFC 8265: Preparation, Enforcement, and Comparison of Internationalized Strings Representing Usernames and Passwords](https://www.rfc-editor.org/rfc/rfc8265.html) — standard
4. [useradd(8) - Linux manual page](https://man7.org/linux/man-pages/man8/useradd.8.html) — documentation
5. [Username considerations for external authentication](https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication) — organisation
