Web Server Design Week 11 Old Dominion University

Slides:



Advertisements
Similar presentations
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Advertisements

Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
Web Server Design Week 14 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/14/10.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
Web Server Design Week 4 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/03/10.
Web Server Design Assignment #1: Basic Operations Due: 02/03/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin.
Web Server Design Week 11 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/24/10.
Web Server Design Assignment #2: Conditionals & Persistence Due: 02/24/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010.
The Basics of HTTP Jason Dean
Web Server Design Week 2 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 1/20/10.
Web Server Design Week 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/10.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/7/10.
Web Server Design Assignment #4: Authentication Due: 04/14/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/10.
Web Server Design Week 12 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/31/10.
Web Server Design Week 10 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/17/10.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.
Web Programming Week 1 Old Dominion University Department of Computer Science CS 418/518 Fall 2007 Michael L. Nelson 8/27/07.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 04/03/12.
Web Server Design Week 15 Old Dominion University Department of Computer Science CS 495/595 Spring 2009 Michael L. Nelson 4/20/09.
CS520 Web Programming Declarative Security (I) Chengyu Sun California State University, Los Angeles.
Web Server Design Week 3 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 1/23/06.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 2/13/06.
Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar Internet Programming.
Authentication & Authorisation Is the user allowed to access the site?
Authentication & .htaccess
Web Server Design Week 10 Old Dominion University
Web Server Design Week 4 Old Dominion University
Web Server Design Assignment #5: Unsafe Methods & CGI
Web Server Design Assignment #4: Authentication
Web Server Design Assignment #2: Conditionals & Persistence
Web Server Design Week 8 Old Dominion University
Web Server Design Week 11 Old Dominion University
Web Server Design Week 7 Old Dominion University
Web Server Design Assignment #5 Extra Credit
Web Server Design Week 4 Old Dominion University
Web Server Design Week 12 Old Dominion University
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Web Server Design Week 15 Old Dominion University
Web Server Design Week 5 Old Dominion University
Web Server Design Week 13 Old Dominion University
Web Server Design Assignment #2: Conditionals & Persistence
Web Server Design Week 16 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Assignment #2: Conditionals & Persistence
Old Dominion University Department of Computer Science
Web Server Design Week 6 Old Dominion University
Web Server Design Week 10 Old Dominion University
Web Server Design Week 13 Old Dominion University
Web Server Design Week 13 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Week 3 Old Dominion University
Web Server Design Week 5 Old Dominion University
Web Server Design Week 11 Old Dominion University
Web Server Design Week 3 Old Dominion University
Web Server Design Week 4 Old Dominion University
Web Server Design Week 16 Old Dominion University
Web Server Design Week 12 Old Dominion University
Web Server Design Week 12 Old Dominion University
Web Server Design Week 14 Old Dominion University
Web Server Design Assignment #1: Basic Operations
Web Server Design Week 6 Old Dominion University
Web Server Design Assignment #5 Extra Credit
Web Server Design Week 3 Old Dominion University
Web Server Design Week 3 Old Dominion University
Old Dominion University Department of Computer Science
Web Server Design Week 7 Old Dominion University
Web Programming Week 1 Old Dominion University
Web Server Design Week 7 Old Dominion University
Presentation transcript:

Web Server Design Week 11 Old Dominion University Department of Computer Science CS 495/595 Spring 2007 Michael L. Nelson <mln@cs.odu.edu> 3/19/07

Authentication: Basic & Digest Defined in RFC-2617 Basic very simple sends password in the clear (very bad) suitable for personalization; not real security Digest uses cryptographic hashes; password not sent in the clear stronger than Basic, but client support not as prevalent does not encrypt content… SSL, SHTTP or equivalent needed for that

Authentication Structure Both methods are structurally similar: when the server receives a request for a protected resource, it responds with: status code “401 Unauthorized” “WWW-Authenticate:” response header the client reissues the same request with the addition of: “Authorization:” request header

Basic “WWW-Authenticate:” response header: WWW-Authenticate: Basic realm=”ODU-CS-595-S06" auth type opaque string to differentiate auth files “Authorization:” request header: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== auth type Base64(username:password)

Scenario client server scenario 2: the client could have sent the GET foo HTTP/1.1 client server 401 Unauthorized WWW-Authenticate: Basic realm=“xyz” GET foo HTTP/1.1 Authorization: Basic mln:gohokies! 200 OK scenario 2: the client could have sent the Authorization string with the initial request mln:gohokies! would be base64’d

How Apache Does It… (Note: we’re not going to do it this way!) In either <Directory> entries in the config file, or “.htaccess” files in directories: AuthType Basic AuthName "Restricted Files" AuthUserFile /usr/local/apache/passwd/passwords Require user rbowen Many more options possible: http://httpd.apache.org/docs/2.0/howto/auth.html

Authentication Example tango.cs.odu.edu:/home/mln/public_html/teaching/cs595-s07/restrict % ls -al total 5 drwxr-xr-x 2 mln faculty 512 Mar 18 15:26 ./ drwxr-xr-x 11 mln faculty 512 Mar 18 15:02 ../ -rwxr-xr-x 1 mln faculty 94 Mar 18 15:27 encode.pl* -rw-r--r-- 1 mln faculty 24 Mar 18 15:17 foo.txt -rw-r--r-- 1 mln faculty 111 Mar 18 15:03 .htaccess tango.cs.odu.edu:/home/mln/public_html/teaching/cs595-s07/restrict % more .htaccess AuthType Basic AuthName "This is What the RFC Calls a Domain" AuthUserFile /home/mln/passwd Require user mln tango.cs.odu.edu:/home/mln/public_html/teaching/cs595-s07/restrict % more encode.pl #!/usr/bin/perl use MIME::Base64; $string = encode_base64("mln:mln"); print "$string\n"; tango.cs.odu.edu:/home/mln/public_html/teaching/cs595-s07/restrict % ./encode.pl bWxuOm1sbg==

Request #1 AIHT.local:/Users/mln % telnet www.cs.odu.edu 80 Trying 128.82.4.2... Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s07/restrict/ HTTP/1.1 Host: www.cs.odu.edu HTTP/1.1 401 Authorization Required Date: Sun, 18 Mar 2007 20:00:30 GMT Server: Apache/2.2.0 WWW-Authenticate: Basic realm="This is What the RFC Calls a Domain" Content-Type: text/html; charset=iso-8859-1 Connection closed by foreign host.

Request #2 AIHT.local:/Users/mln % telnet www.cs.odu.edu 80 Trying 128.82.4.2... Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s07/restrict/ HTTP/1.1 Host: www.cs.odu.edu Authorization: Basic bWxuOm1sbg== HTTP/1.1 200 OK Date: Sun, 18 Mar 2007 20:05:01 GMT Server: Apache/2.2.0 Content-Type: text/html Connection closed by foreign host.

Why Not a “403 Forbidden” ? 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.