Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow consumer secret in oauth as well

  • Loading branch information...
commit 4e87be50baf7edd9c044d7f78937a0a3d32e00b8 1 parent d9c51c6
@mwunsch authored
Showing with 4 additions and 3 deletions.
  1. +2 −1  lib/weary/request.rb
  2. +2 −2 lib/weary/resource.rb
View
3  lib/weary/request.rb
@@ -111,12 +111,13 @@ def basic_auth(*credentials)
@basic_auth
end
- def oauth(consumer_key=nil, access_token=nil, token_secret=nil)
+ def oauth(consumer_key=nil, access_token=nil, token_secret=nil, consumer_secret=nil)
if !consumer_key.nil?
@oauth = true
options = {:consumer_key => consumer_key}
options[:token] = access_token unless access_token.nil? || access_token.empty?
options[:token_secret] = token_secret unless token_secret.nil? || token_secret.empty?
+ options[:consumer_secret] = consumer_secret unless consumer_secret.nil? || consumer_secret.empty?
use Weary::Middleware::OAuth, [options]
end
@oauth
View
4 lib/weary/resource.rb
@@ -84,9 +84,9 @@ def basic_auth!(user = :username, pass = :password)
# :consumer_key)
# token - The parameter in which to expect the user access token (defaults
# to :token)
- def oauth!(key = :consumer_key, token = :token, secret = :token_secret)
+ def oauth!(key = :consumer_key, token = :token, secret = :token_secret, consumer_secret = :consumer_secret)
@authenticates = :oauth
- @credentials = [key, token, secret]
+ @credentials = [key, token, secret, consumer_secret]
end
# Does the Resource anticipate some sort of authentication parameters?
Please sign in to comment.
Something went wrong with that request. Please try again.