This is an extension of the following repository.
Given the task to obtain a user name with length requirements and password with password confirmation along with special rules this project shows one method to perform a new login.
Things like checking to see if the user name has been used already is not provided.
For complete details see the following TechNet article.