Skip to content

Commit

Permalink
OAuth Session 1.0 (draft) support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshi Nakamura committed Dec 12, 2010
1 parent f4f6d9a commit 52d104f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/httpclient/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def parse_challenge_header(challenge)
#
# WWWAuth has sub filters (BasicAuth, DigestAuth, NegotiateAuth and
# SSPINegotiateAuth) and delegates some operations to it.
# NegotiateAuth requires 'ruby/ntlm' module.
# SSPINegotiateAuth requires 'win32/sspi' module.
# NegotiateAuth requires 'ruby/ntlm' module (rubyntlm gem).
# SSPINegotiateAuth requires 'win32/sspi' module (rubysspi gem).
class WWWAuth < AuthFilterBase
attr_reader :basic_auth
attr_reader :digest_auth
Expand Down Expand Up @@ -553,6 +553,10 @@ class Config
attr_accessor :version
attr_accessor :callback
attr_accessor :verifier

# for OAuth Session 1.0 (draft)
attr_accessor :session_handle

attr_reader :signature_handler

attr_accessor :debug_timestamp
Expand Down Expand Up @@ -582,6 +586,7 @@ def initialize(*args)
:verifier
)
@http_method ||= :post
@session_handle = nil
@signature_handler = {}
end
end
Expand Down Expand Up @@ -684,6 +689,7 @@ def calc_cred(req, config)
header['oauth_version'] = config.version if config.version
header['oauth_callback'] = config.callback if config.callback
header['oauth_verifier'] = config.verifier if config.verifier
header['oauth_session_handle'] = config.session_handle if config.session_handle
signature = sign(config, header, req)
header['oauth_signature'] = signature
# no need to do but we should sort for easier to test.
Expand Down

0 comments on commit 52d104f

Please sign in to comment.