Lab 3 – Chat with SQL Database

Team assignments

Goal

Create an enhanced Chat system with a SQL Database supporting new features.

Method

You are to utilize an SQL database with at least one table (probably two if you do options 5 or 6) you to provide enhanced fetures to the chat app. this should include at least 3 of the following, or you propose something else (and get it approved).

  1. User registration. When registering the user information will now be stored in a database, and this data will be used to valadate logins. As before it will make sure usernames and emails are unique.
  2. User login. Once a user is registered, they must log in to access the chat system. The password will now be used.
  3. System security. The original system was insecure. Using the REST interface, anyone can issue a command, pretending to be anyone they like. How can we secure the system? There are two ways. Afirst (and easiest but least secure) is the retain the username and password in the client, and include these fields passed for every transaction. A better way is to create a random and unique token whenever someone logs in, and pass that token to the client. The client now uses that token, rather then the username, whenever it hits the server with a request. The service must maintain a association of the usernames to the tokens, and uses this to idenify who the request came from. The tokens must be removed from the assocaite list whenever someone log out.
  4. User log out. Should be a button to log out, but leaving the page should automatically log the user out. Remove the token.
  5. Chat memory. Each users session remembers the chat text between login, and when they log out and back in, the messages are restored to the chat box.
  6. Individual chat. A user may select a user (from a list) and send a private message. If that message is not logged in they will see it when they log in. Essentually you must keep a log of all the messages for each use pair, or group.
Scroll to Top