<@U0A71G31CDV> can starrocks create users with an ...
# questions-and-troubleshooting
n
@Rocky can starrocks create users with an email id?
r
According to the StarRocks documentation, you cannot use a full email ID as a native StarRocks username. 1. Naming Convention Limits The StarRocks System Limits define strict naming conventions for all objects, including usernames. A username: * Can only consist of digits (0-9), letters (a-z or A-Z), and underscores (_). * Cannot contain special characters such as the at sign (@) or dots (.), which are required for an email address. * Can be up to 128 characters in length. 2. Ambiguity with User Identity StarRocks uses the format
username@'userhost'
to uniquely identify a user (known as a "user identity"). If a username itself contained an
@
symbol (e.g.,
<mailto:rocky@starrocks.com|rocky@starrocks.com>
), the identity would look like
<mailto:rocky@starrocks.com|rocky@starrocks.com>@'%'
. This creates ambiguity for the MySQL protocol and the StarRocks parser when distinguishing the username from the host. 3. External Authentication (LDAP, JWT, OAuth 2.0) If you are using external authentication (available in v3.x+), you can still use your email-based identity in the external system, but it must be handled as follows: * LDAP: You can map an external LDAP user (whose Distinguished Name or email might be complex) to a simple internal StarRocks username that follows the
[a-zA-Z0-9_]
rule. * JWT/OAuth 2.0: While the
principal_field
(such as
email
or
sub
) in your token might contain an email address, StarRocks requires the login username passed via the client to match an existing StarRocks user account. If that account name must follow system limits, the email cannot be used directly as the login name. * Security Integration: In newer versions (v3.5+), StarRocks supports "Security Integration" which can create virtual users for SSO. However, even in these cases, the identity used for authorization within StarRocks generally adheres to the standard naming conventions. Summary Feature | Supported for Email ID? Native Username | No (limited to
[a-zA-Z0-9_]
) LDAP login name | Yes, but must be mapped to a valid internal username JWT/OAuth2 Principal | Yes, but the login string must be a valid StarRocks username Recommendation: For your StarRocks usernames, use a format like
firstname_lastname
or
uid123
to stay within the supported character set. Referencesadministration/user_privs/authentication/native_authentication.mdadministration/user_privs/authorization/user_privs.mdadministration/user_privs/authorization/ranger_plugin.mdadministration/user_privs/authentication/jwt_authentication.md