Web Server Design Week 10 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/17/10.

Slides:



Advertisements
Similar presentations
The Basic Authentication Scheme of HTTP. Access Restriction Sometimes, we want to restrict access to certain Web pages to certain users A user is identified.
Advertisements

HTTP – HyperText Transfer Protocol
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
 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.
Web Programming Week 10 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 11/02/10.
Human-Computer Interface Course 5. ISPs and Internet connection.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
FTP (File Transfer Protocol) & Telnet
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Application Layer 2 Figures from Kurose and Ross
HTTP & Security (Some of the slides in this file were adapted from Oppliger’s online slides at
Web Server Design Week 14 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/14/10.
Web Programming Week 1 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 8/31/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.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
Web Server Design Week 11 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/24/10.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
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.
Krerk Piromsopa. 1 Department of Computer Engineering. Chulalongkorn University. Web Application Generic Issues.
Web Server Design Week 15 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/21/10.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
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 Assignment #5: Unsafe Methods & CGI Due: 05/05/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin.
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 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.
Authentication & Authorisation Is the user allowed to access the site?
Hypertext Transfer Protocol (HTTP) COMP6218 Web Architecture Dr Nicholas Gibbins –
Authentication & .htaccess
Web Server Design Week 10 Old Dominion University
Web Server Design Assignment #4: Authentication
Web Server Design Assignment #2: Conditionals & Persistence
Web Server Design Week 11 Old Dominion University
Web Server Design Assignment #5 Extra Credit
Web Server Design Week 4 Old Dominion University
Web Server Design Week 15 Old Dominion University
Web Server Design Week 5 Old Dominion University
Web Server Design Week 8 Old Dominion University
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 11 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 7 Old Dominion University
Web Server Design Week 7 Old Dominion University
Presentation transcript:

Web Server Design Week 10 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/17/10

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 ♣ “Authorization:” request header: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== ♣ “WWW-Authenticate:” response header: WWW-Authenticate: Basic realm=”St. Patrick’s Day" auth typeopaque string to differentiate auth filesauth typeBase64(username:password)

Scenario clientserver GET shamrock HTTP/ Unauthorized WWW-Authenticate: Basic realm=“Paddy’s Day” GET foo HTTP/1.1 Authorization: Basic St.Patrick:HolyTrinity St.Patrick:HolyTrinity would be base64’d 200 OK scenario 2: the client could have sent the Authorization string with the initial request

How Apache Does It… (Note: we’re not going to do it this way!) ♣ In either entries in the config file, or “.htaccess” files in directories: AuthType Basic AuthName "This is what RFC 2617 calls a Domain" AuthUserFile /usr/local/apache/passwd/passwords Require user St.Patrick ♣ Many more options possible: ♣

Authentication Example (mln-web:~/public_html/restricted) mklein% ls -al total 12 drwxr-xr-x 2 mklein sshd 136 Mar 10 17:49. drwxr-xr-x 7 mklein sshd 336 Mar 10 17:48.. -rw-r--r-- 1 mklein sshd 125 Mar 10 17:48.htaccess -rwxr-xr-x 1 mklein sshd 93 Mar 10 17:49 encode.pl -rw-r--r-- 1 mklein sshd 24 Mar 10 17:48 paddys.txt (mln-web:~/public_html/restricted) mklein% more.htaccess AuthType Basic AuthName "It's St.Patrick's Day, Lads - pwd required" AuthUserFile /home/mklein/cs595passwd Require user st.patrick (mln-web:~/public_html/restricted) mklein% more encode.pl #!/usr/bin/perl use MIME::Base64; $str = encode_base64(”st.patrick:shamrock"); print "$str\n"; (mln-web:~/public_html/restricted) mklein%./encode.pl c3QucGF0cmljazpzaGFtcm9jaw==

Request #1 bookpower:~ mk$ telnet mln-web.cs.odu.edu 80 Trying Connected to mln-web.cs.odu.edu. Escape character is '^]'. HEAD /~mklein/restricted/ HTTP/1.1 Host: mln-web.cs.odu.edu Connection: close HTTP/ Authorization Required Date: Wed, 10 Mar :50:35 GMT Server: Apache WWW-Authenticate: Basic realm="It's St.Patrick's Day, Lads - pwd required" Connection: close Content-Type: text/html; charset=iso Connection closed by foreign host.

Request #2 bookpower:~ mk$ telnet mln-web.cs.odu.edu 80 Trying Connected to mln-web.cs.odu.edu. Escape character is '^]'. HEAD /~mklein/restricted/ HTTP/1.1 Host: mln-web.cs.odu.edu Connection: close Authorization: Basic c3QucGF0cmljazpzaGFtcm9jaw== HTTP/ OK Date: Wed, 10 Mar :51:37 GMT Server: Apache Connection: close Content-Type: text/html;charset=ISO Connection closed by foreign host.

Why Not a “403 Forbidden” ? 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.