Top Banner
User Authentication with DB Cs346 Fall 2010
23

User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Dec 14, 2015

Download

Documents

Seamus Dagley
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

User Authentication with DB

Cs346 Fall 2010

Page 2: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Requirements

• Web site is for registered users only– Username and password– Password is encripted

Page 3: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Design• Database student– Table auth_user– Re-use m12 scripts to create the table

• MVC– GUI: xhtml for registration entry– PHP: process the input and insert the entry into DB

table auth_user– DB: auth_user– GUI: xhtml for existing user login– PHP: process the username-password, query

auth_user

Page 4: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Development stages

Page 5: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.
Page 6: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Specify name of table and # columns

Page 7: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Define field for auth_user

Page 8: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Add table ‘auth_user’ to DB ‘student’

The above message was generated by the PHP sript.Is it really true?Use m11 script to list tables

Page 9: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Verify that table ‘auth_user’ is created

etc. Information_schema has too many attributes

Page 10: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

New User Registration

Page 11: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

One entry added

Page 12: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Is the entry really there in DB?

• Use MySQL Console• Write a PHP script to query the database

Page 13: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || books || cs346 || ex04a || mailinglist || mysql || products || student || testdb1 |+--------------------+9 rows in set (0.00 sec)

mysql> use student;Database changedmysql> show tables;+-------------------+| Tables_in_student |+-------------------+| auth_user || my_music |+-------------------+2 rows in set (0.00 sec)

Page 14: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

mysql> use student;Database changedmysql> show tables;+-------------------+| Tables_in_student |+-------------------+| auth_user || my_music |+-------------------+2 rows in set (0.00 sec)

mysql> SELECT * FROM auth_user;Empty set (0.00 sec)

mysql> SELECT * FROM auth_user;+--------+--------+----------+-------------------------------------------+| f_name | l_name | username | password |+--------+--------+----------+-------------------------------------------+| John | Doe | john.doe | *54B88827AF6DA4FCE049F501D462BE6A9F7EF979 |+--------+--------+----------+-------------------------------------------+1 row in set (0.00 sec)

mysql>

Page 15: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Existing User Login

Page 16: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Existing User Login - successful

Page 17: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Existing User Login - Failure

Page 18: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Existing User Login - Failure

Page 19: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Next

• Upload to remote server• Testing– Repeat all the steps in the local server:• Create table auth_user• Enter new registrations• Authenticate the users

Page 20: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

Add a 2nd New Registration

Page 21: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

ok

Page 22: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.
Page 23: User Authentication with DB Cs346 Fall 2010. Requirements Web site is for registered users only – Username and password – Password is encripted.

success