요즘은 사실 CORBA나 DCOM과 같은 분산 네트워크 기술이 인기가 없다. 관련 기술들을 세팅하고 사용하는 지식과 비용이 만만치 않고, 또한 그 기술들이 시스템 종속적이며, 무엇보다도 이 화려한 기술들이 결국은 네트워크 방화벽을 뚫지 못한다는 치명적인 단점이 있기 때문이다.
그래서 HTTP(80 Port) 하나면 충분하고 유효하다. 그러나 인증 및 보안은 계속 이슈가 되고 있다.
일단, OMA 스펙에 따라 본 RFC 문서를 보면서 HTTP 인증을 대충 구현해볼 생각이다. (OMA DCD 스펙에서는 Digest 인증과 관련하여 RFC 2617을 참고하도록 명시하고 있다.)
다음은 HTTP 기본 인증의 예이다.
(출처: http://www.governmentsecurity.org/articles/OverviewofHTTPAuthentication.php)
less..
GET /download/report.doc HTTP/1.1
Accept: application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Host: 10.0.0.5:81
Connection: Keep-Alive
2. Server reads configuration files and determines that resource falls within a protected directory.
Server can only allow access to known users.
3. Server Sends HTTP 401 Authorization Required Response
HTTP/1.1 401 Authorization Required
Date: Sat, 20 Oct 2001 19:28:06 GMT
Server: Apache/1.3.19 (Unix)
WWW-Authenticate: Basic realm="File Download Authorization"
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
[ html error page for browser to show if user hits cancel ]
3. Browser displays Username/ Password prompt displaying host name and authentication realm.
[image auth.jpg]
5. Client Resubmits Request with Username/ Password
GET /download/report.doc HTTP/1.1
Accept: application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Host: 10.0.0.5:81
Connection: Keep-Alive
Authorization: Basic ZnJlZDp0aGF0cyBtZQ==
6. Server compares client information to its user/password list.
b. authorization fails: server resends 401 Authorization Required header
c. Client hits cancel: browser shows error message sent along with 401 message.
less..
다음은 HTTP 다이제스트 인증을 구현한 예제이다.
(출처: http://en.wikipedia.org/wiki/Digest_access_authentication
less..
GET /dir/index.html HTTP/1.0
Host: localhost
Server response:
HTTP/1.0 401 Unauthorised
Server: SokEvo/0.9
Date: Sun, 10 Apr 2005 20:26:47 GMT
WWW-Authenticate: Digest realm="testrealm@host.com",
qop="auth,auth-int",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
opaque="5ccc069c403ebaf9f0171e9517f40e41"
Content-Type: text/html
Content-Length: 311
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML>
<HEAD>
<TITLE>Error</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
</HEAD>
<BODY><H1>401 Unauthorised.</H1></BODY>
</HTML>
Client request (user name "Mufasa", password "Circle Of Life"):
GET /dir/index.html HTTP/1.0
Host: localhost
Authorization: Digest username="Mufasa",
realm="testrealm@host.com",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="/dir/index.html",
qop=auth,
nc=00000001,
cnonce="0a4f113b",
response="6629fae49393a05397450978507c4ef1",
opaque="5ccc069c403ebaf9f0171e9517f40e41"
Server response:
HTTP/1.0 200 OK
Server: SokEvo/0.9
Date: Sun, 10 Apr 2005 20:27:03 GMT
Content-Type: text/html
Content-Length: 7984
less..
다음은 HTTP 인증이 지니고 있는 근본적인 제약사항들에 대해 극복해보려는 사례 중 하나이다.
http://www.berenddeboer.net/rest/authentication.html
'공부 이야기 > 컴퓨터 몽땅' 카테고리의 다른 글
| SD메모리카드 포멧 프로그램 (0) | 2008/08/22 |
|---|---|
| WinXP Progress Bar (version 1.2) (0) | 2008/08/17 |
| HTTP Authentication: Basic and Digest Access Authentication (RFC 2617) (1) | 2008/08/16 |
| 정규표현식에 관한 정리 (0) | 2008/08/08 |
| Awk 사용법 (0) | 2008/08/06 |
| Virtual IP setup (0) | 2008/08/04 |


rfc2617.txt.pdf
이올린에 북마크하기


