Final Project Implementation of Basic Authentication.

22
Final Project Final Project Implementation of Basic Implementation of Basic Authentication Authentication

Transcript of Final Project Implementation of Basic Authentication.

Page 1: Final Project Implementation of Basic Authentication.

Final ProjectFinal Project

Implementation of Basic Implementation of Basic AuthenticationAuthentication

Page 2: Final Project Implementation of Basic Authentication.

DevelopersDevelopers

GirijaGirija

SujathaSujatha

PremalathaPremalatha

Page 3: Final Project Implementation of Basic Authentication.

Definition of AuthenticationDefinition of Authentication

Authentication is the process of Authentication is the process of determining whether someone or determining whether someone or

something is, in fact, who or what it something is, in fact, who or what it is declared to be is declared to be

Page 4: Final Project Implementation of Basic Authentication.

ModulesModules

File Management and Handling the File Management and Handling the DatabaseDatabase

Edit Users Email and ProgramsEdit Users Email and Programs Change Password and Delete User Change Password and Delete User

Account from .htpasswd and Account from .htpasswd and DatabaseDatabase

Page 5: Final Project Implementation of Basic Authentication.

Project DescriptionProject Description

Design and implement a new web Design and implement a new web module, which allows an admin to module, which allows an admin to manage users - issuing them manage users - issuing them accounts, edit, and delete them, accounts, edit, and delete them, while providing the user the ability to while providing the user the ability to change their password. change their password.

Page 6: Final Project Implementation of Basic Authentication.

The admin chooses the staff's email The admin chooses the staff's email from the database list and can from the database list and can

multiple-select programs (from the multiple-select programs (from the database), from which they may database), from which they may

belong to. belong to.

Page 7: Final Project Implementation of Basic Authentication.

Code for verifying username and Code for verifying username and passwordpassword

if ( $userlist{$username} eq if ( $userlist{$username} eq crypt($password,crypt($password,$userlist{$username}))$userlist{$username}))

{{

Print “Successfully Logged in”;Print “Successfully Logged in”;

}}

Page 8: Final Project Implementation of Basic Authentication.

Code for saving new password in .htpasswdCode for saving new password in .htpasswd

if ( ($userlist{$username} eq if ( ($userlist{$username} eq crypt($oldpassword,crypt($oldpassword,$userlist{$username}) ) {$userlist{$username}) ) {

$userlist{$username} = $userlist{$username} = crypt($newpassword,"giri");crypt($newpassword,"giri");

&save_passwd_to_file;&save_passwd_to_file;

}}&save_passwd_to_file&save_passwd_to_fileforeach (keys(%userlist)) foreach (keys(%userlist)) { { print OUT "$_:$userlist{$_}\n";print OUT "$_:$userlist{$_}\n"; }}

Page 9: Final Project Implementation of Basic Authentication.

Admin PageAdmin Page

Page 10: Final Project Implementation of Basic Authentication.

User PageUser Page

Page 11: Final Project Implementation of Basic Authentication.

Difficulties FacedDifficulties Faced

Sending email to the recipient Sending email to the recipient addressaddress

Passing variable from one file to Passing variable from one file to another fileanother file

Dealing with password encryption.Dealing with password encryption.

Page 12: Final Project Implementation of Basic Authentication.

What we have LearntWhat we have Learnt

Learned to use sql in perl cgi Learned to use sql in perl cgi programsprograms

Became familiar with Html and mysqlBecame familiar with Html and mysqlLearned to pass variables from one Learned to pass variables from one

file to another.file to another.Learned to use subroutines. Learned to use subroutines.

Page 13: Final Project Implementation of Basic Authentication.

Admin Flow ChartAdmin Flow Chart

Admin

Create User Account Managing the filesEdit and Delete

User account

Page 14: Final Project Implementation of Basic Authentication.

User Flow ChartUser Flow Chart

User

Change Password

Page 15: Final Project Implementation of Basic Authentication.

OverviewOverview

Files we used for this Project are as Files we used for this Project are as follows:follows:

Finalproject.cgi-creates mainpage for Finalproject.cgi-creates mainpage for AdminAdmin

http://perl.cs.ohlone.edu/~gen19/Finhttp://perl.cs.ohlone.edu/~gen19/FinalProject.cgialProject.cgi

Page 16: Final Project Implementation of Basic Authentication.

Create.cgi-It creates new user and saves Create.cgi-It creates new user and saves the username and encrypted password in the username and encrypted password in .htpasswd file .It will send the username .htpasswd file .It will send the username and password to the user’s email.and password to the user’s email.

Password = welcomePassword = welcome

http://perl.cs.ohlone.edu/~gen19/create.cgihttp://perl.cs.ohlone.edu/~gen19/create.cgi

Page 17: Final Project Implementation of Basic Authentication.

login.cgi-It allows user to login after login.cgi-It allows user to login after checking username and passwordchecking username and password. .

http://perl.cs.ohlone.edu/~gen19/logihttp://perl.cs.ohlone.edu/~gen19/login.cgi n.cgi

changepass.cgi-It allows user to changepass.cgi-It allows user to change the passwordchange the password..

http://perl.cs.ohlone.edu/~gen19/chahttp://perl.cs.ohlone.edu/~gen19/changepass.cgingepass.cgi

Page 18: Final Project Implementation of Basic Authentication.

editemail.cgi-it gets valid username to edit their editemail.cgi-it gets valid username to edit their emailsemails. .

http://perl.cs.ohlone.edu/~gen19/editemail.cgihttp://perl.cs.ohlone.edu/~gen19/editemail.cgi

newemail.cgi-It gets the new email to be editednewemail.cgi-It gets the new email to be edited. .

http://perl.cs.ohlone.edu/~gen19/newemail.cgi http://perl.cs.ohlone.edu/~gen19/newemail.cgi

Page 19: Final Project Implementation of Basic Authentication.

updateemail.cgi-It updates new email in updateemail.cgi-It updates new email in database. [Tablename:gen19_userinfo]database. [Tablename:gen19_userinfo]

http://perl.cs.ohlone.edu/~gen19/updateemhttp://perl.cs.ohlone.edu/~gen19/updateemail.cgiail.cgi

editprogram.cgi-it gets valid username to editprogram.cgi-it gets valid username to edit their programsedit their programs..

http://perl.cs.ohlone.edu/~gen19/editprograhttp://perl.cs.ohlone.edu/~gen19/editprogram.cgim.cgi

Page 20: Final Project Implementation of Basic Authentication.

newprogram.cgi-It gets the new program to be newprogram.cgi-It gets the new program to be editededited..

http://perl.cs.ohlone.edu/~gen19/newprogram.chttp://perl.cs.ohlone.edu/~gen19/newprogram.cgigi

updateprogram.cgi-It updates new program in updateprogram.cgi-It updates new program in database. [Tablename:gen19_userinfo]database. [Tablename:gen19_userinfo]

http://perl.cs.ohlone.edu/~gen19/updateprograhttp://perl.cs.ohlone.edu/~gen19/updateprogram.cgim.cgi

Page 21: Final Project Implementation of Basic Authentication.

delete.cgi-It deletes the record from delete.cgi-It deletes the record from database and .htpasswd file.database and .htpasswd file.

http://perl.cs.ohlone.edu/~gen19/delhttp://perl.cs.ohlone.edu/~gen19/delete.cgiete.cgi

Page 22: Final Project Implementation of Basic Authentication.

Thank YouThank You

Many thanks to Prof Jon Degallier for Many thanks to Prof Jon Degallier for helping us with our learning process.helping us with our learning process.

The Discussion Board is very useful The Discussion Board is very useful to help each other. We really to help each other. We really appreciate it and thanks to all. appreciate it and thanks to all.