Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working on a java code and here is the info on the project: For the zoo, pl

ID: 3823962 • Letter: I

Question

I am working on a java code and here is the info on the project:

For the zoo, please develop an authentication system that manages both authentication and authorization. You have been given a credentials file that contains credential information for authorized users. You have also been given three files, one for each role: zookeeper, veterinarian, and admin. Each role file describes the data the particular role should be authorized to access. Create an authentication system that does all of the following: Asks the user for a username Asks the user for a password Converts the password using a message digest five (MD5) hash

It is not required that you write the MD5 from scratch. Use the code located in this document and follow the comments in it to perform this operation. Checks the credentials against the valid credentials provided in the credentials file

Use the hashed passwords in the second column; the third column contains the actual passwords for testing and the fourth row contains the role of each user. Limits failed attempts to three before notifying the user and exiting the program Gives authenticated users access to the correct role file after successful authentication

The system information stored in the role file should be displayed. For example, if a zookeeper’s credentials is successfully authenticated, then the contents from the zookeeper file will be displayed. If an admin’s credentials is successfully authenticated, then the contents from the admin file will be displayed. Allows a user to log out Stays on the credential screen until either a successful attempt has been made, three unsuccessful attempts have been made, or a user chooses to exit

Here are the five text files I was given:

admin.txt

Hello, System Admin!

As administrator, you have access to the zoo's main computer system. This allows you to monitor users in the system and their roles.

credentials.txt

griffin.keyes 108de81c31bf9c622f76876b74e9285f "alphabet soup" zookeeper rosario.dawson 3e34baa4ee2ff767af8c120a496742b5 "animal doctor" admin bernie.gorilla a584efafa8f9ea7fe5cf18442f32b07b "secret password" veterinarian donald.monkey 17b1b7d8a706696ed220bc414f729ad3 "M0nk3y business" zookeeper jerome.grizzlybear 3adea92111e6307f8f2aae4721e77900 "grizzly1234" veterinarian bruce.grizzlybear 0d107d09f5bbe40cade3de5c71e9e9b7 "letmein" admin

validateCredentials.txt

veterinarian.txt

Hello, Veterinarian!

As veterinarian, you have access to all of the animals' health records. This allows you to view each animal's medical history, current treatments/illnesses (if any), and maintain a vaccination log.

****zookeeper.txt****

Hello, Zookeeper!

As zookeeper, you have access to all of the animals information and their daily monitoring logs. This allows you to track their feeding habits, habitat conditions, and general welfare.

Finally, this is the code that I have so far, but when I try to run it in Netbeans it just won't work.

When I run the program in NetBeans it just says "run: BUILD SUCCESSFUL (total time: 0 seconds). I'm not sure why it doesn't prompt me for a username and then password here?

Thanks for the help here!!!

Explanation / Answer

The program is running fine on my system. Make sure you have kept credentials.txt in the same project folder. And make sure you are actually checking in the right console window . Clean the project space. check Build Libraries. Build Again and Run the program.

And make sure in your credentials.txt , text is properly formatted as below: -

credentials.txt

griffin.keyes 108de81c31bf9c622f76876b74e9285f "alphabet soup" zookeeper
rosario.dawson 3e34baa4ee2ff767af8c120a496742b5 "animal doctor" admin
bernie.gorilla a584efafa8f9ea7fe5cf18442f32b07b "secret password" veterinarian
donald.monkey 17b1b7d8a706696ed220bc414f729ad3 "M0nk3y business" zookeeper
jerome.grizzlybear 3adea92111e6307f8f2aae4721e77900 "grizzly1234" veterinarian
bruce.grizzlybear 0d107d09f5bbe40cade3de5c71e9e9b7 "letmein" admin

i.e. there should be line break after each password entry. This I came to know when I was running the program.

Below is the sample run of your code: -

**WELCOME**
1) Login
2) Exit
1
Input username:griffin.keyes
Input password:alphabet soup
Hello, Zookeeper!
As zookeeper, you have access to all of the animals information and their daily monitoring logs. This allows you to track their feeding habits, habitat conditions, and general welfare.

1) Logout.
2) Exit.
1
**WELCOME**
1) Login
2) Exit
2

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote