GithubHelp home page GithubHelp logo

authentication-module's Introduction

Authentication System

It is a simple authentication module for a system that manages users’ login information. The authentication module allows the user to create and modify their information. It also provides the function to authenticate the user by password.

Start menu

When the program is executed, the following menu should be displayed:

Welcome to the COMP2396 Authentication system!
1. Authenticate user
2. Add user record
3. Edit user record
4. Reset user password
What would you like to perform?

Please enter your command (1-4, or 0 to terminate the system): 

Hash

The system stores the hashed password instead of the plain text password. Hash class is used in the following:

  • Hash the user input password when adding a user.
  • Hash the user input password for the authentication.
  • Hash the user input password when the user change or reset the password.

Add user record

Please enter your username: Raymond
Please enter your password: 123456
Your password has to fulfil: at least 1 small letter, 1 capital letter, 1 digit!
Please enter your password: 123456Abc
Please re-enter your password: 123456Abc
Please enter your full name: Raymond Chan
Please enter your email address: [email protected]
Please enter your Phone number: 12345678
Record added successfully!

Modify user record

  • To modify the user record, the user has to provide the username and password before he can edit the record.
  • Allow user to change the Full name, password and email address.
Please enter your username: Raymond
Please enter your password: 123456Abc
Login success! Hello Raymond!
Please enter your new password: 123456Acb
Please re-enter your new password: 123456Acb
Please enter your new full name: Raymond Chan
Please enter your new email address: [email protected]
Record update successfully!

Authentication

  • The authentication module would validate if the user can provide correct username and password.
  • When the user successfully login, the last login date will be updated.
  • If a user failed to login for 3 times, his account will be locked and not allowed to login.
Please enter your username: Raymond
Please enter your password: 123456Abc
Login success! Hello Raymond!
  • If the failed count is less than 3 and the user can login successfully, the failed count will reset to 0.
  • If the failed count is greater than or equal to 3, the user account will be locked, i.e. the user will not be allowed to login again.
Please enter your username: Raymond
Please enter your password: 147852369
Login failed!
Please enter your username: Raymond
Please enter your password: 147852369
Login failed!
Please enter your username: Raymond
Please enter your password: 147852369
Login failed!
Please enter your username: Raymond
Please enter your password: 147852369
Login failed! Your account has been locked!

Storing records

  • The system reads a file “User.txt” when it is executed.
  • If the file does not exist, the program will create a blank “User.txt” automatically.
  • The system stores the record in JSON format.

The system stores the user records to a file when:

  • The program terminates.
  • A new user record added.
  • When a user changed / reset the password.

Reset password

  • Only the “administrator” account can reset the user password.
  • If the “administrator” not exists, prompt a message to ask the user to add an “administrator” account.
  • The fail count will reset to 0 after the user password is changed.
  • The “Account locked” should be reset to false.
Please enter the password of administrator: 741852Abc
Please enter the user account need to reset: raymond
Please enter the new password: 789456Abc
Please re-enter the new password: 789456Abd
Password not match! Please enter the new password: 789456Abc
Please re-enter the new password: 789456Abc
Password update successfully!

authentication-module's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.