Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clarified Net::HTTP integration

Since Net::HTTP is single-request oriented I re-worded the README to
clarify how Net::HTTP::DigestAuth must be used and added some comments
to the example.

Fixes #3
  • Loading branch information...
commit 1c05d4bc880ce06bcfac022b8a5aadddc09c0b50 1 parent 6580eb2
@drbrain authored
Showing with 14 additions and 15 deletions.
  1. +9 −14 README.txt
  2. +5 −1 lib/net/http/digest_auth.rb
View
23 README.txt
@@ -1,23 +1,18 @@
= net-http-digest_auth
-* http://github.com/drbrain/net-http-digest_auth
-* http://seattlerb.rubyforge.org/net-http-digest_auth
-* http://www.rfc-editor.org/rfc/rfc2617.txt
+code :: http://github.com/drbrain/net-http-digest_auth
+rdoc :: http://docs.seattlerb.org/net-http-digest_auth
+other :: http://www.rfc-editor.org/rfc/rfc2617.txt
== DESCRIPTION:
An implementation of RFC 2617 - Digest Access Authentication. At this time
-the gem does not fully integrate with Net::HTTP and can be used for with other
-HTTP clients.
+the gem does not drop in to Net::HTTP and can be used for with other HTTP
+clients.
-== FEATURES/PROBLEMS:
-
-* Implements RFC 2617 for digest authentication
-* Does not fully integrate with Net::HTTP
-
-== SYNOPSIS:
-
- See Net::HTTP::DigestAuth
+In order to use net-http-digest_auth you'll need to perform some request
+wrangling on your own. See the class documentation at Net::HTTP::DigestAuth
+for an example.
== INSTALL:
@@ -27,7 +22,7 @@ HTTP clients.
(The MIT License)
-Copyright (c) 2010 Eric Hodel
+Copyright (c) Eric Hodel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
6 lib/net/http/digest_auth.rb
@@ -14,6 +14,8 @@
# require 'net/http'
# require 'net/http/digest_auth'
#
+# digest_auth = Net::HTTP::DigestAuth.new
+#
# uri = URI.parse 'http://localhost:8000/'
# uri.user = 'username'
# uri.password = 'password'
@@ -23,13 +25,15 @@
# req = Net::HTTP::Get.new uri.request_uri
#
# res = h.request req
+# # res is a 401 response with a WWW-Authenticate header
#
-# digest_auth = Net::HTTP::DigestAuth.new
# auth = digest_auth.auth_header uri, res['www-authenticate'], 'GET'
#
+# # create a new request with the Authorization header
# req = Net::HTTP::Get.new uri.request_uri
# req.add_field 'Authorization', auth
#
+# # re-issue request with Authorization
# res = h.request req
class Net::HTTP::DigestAuth

0 comments on commit 1c05d4b

Please sign in to comment.
Something went wrong with that request. Please try again.