Top community members
All Questions Ask Question

Welcome to Dirask IT community! ❀ đŸ’»
We are community of people that helps each other.

If you think you have some skills to help others

help someone and become a part of our community - List Q & A

What are the valid characters in usernames?

1 answers
1 points

I need to create authentication validation and I need to decide what characters we will allow to in username. For now I think:

  • letters
  • numbers
  • dots

Is there a problem with using underscore (_) and dash (-)?
Or it should be avoided to allow users to use such characters?
If yes, why?
Thanks

1 answers
2 points

Everything depends where would you like to use this username later, how sent and have it easly readable during transfering and storing.

In my opinion following characters ._-0-9a-zA-Z are good because make username clear. It is easy later even to use username in request parameter ?username=my-user-name for rows filtering/searching and link is very clear.

Only one additional limitation I would like to add is to do not let for any user to create login that starts, ends or contains in direct sibling following characters ._-.

If you want to integrate it with some service like gmail I recommend to look at google documentations.

 

0 comments Add comment

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey 👋
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more