Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updates validate helper to accept a key and secret, or use CONSTANT d…

…efaults if provided.

git-svn-id: http://opensocial-ruby-client.googlecode.com/svn/trunk@12 f65e88d0-acf7-11dd-a0fe-71d3f493a0de
  • Loading branch information...
commit f8b9af58ce8350e6bf7cf29861b182dd920afd72 1 parent 2fb8332
api.dwh@google.com authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/opensocial/auth/validate.rb
View
8 lib/opensocial/auth/validate.rb
@@ -21,8 +21,8 @@ module OpenSocial #:nodoc:
# Provides verification of signed makeRequest using OAuth with HMAC-SHA1.
# class ExampleController < ApplicationController
- # CONSUMER_KEY = '623061448914'
- # CONSUMER_SECRET = 'uynAeXiWTisflWX99KU1D2q5'
+ # OpenSocial::Auth::CONSUMER_KEY = '623061448914'
+ # OpenSocial::Auth::CONSUMER_SECRET = 'uynAeXiWTisflWX99KU1D2q5'
#
# include OpenSocial::Auth
#
@@ -35,8 +35,8 @@ module OpenSocial #:nodoc:
module Auth
- def validate
- consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET)
+ def validate(key = CONSUMER_KEY, secret = CONSUMER_SECRET)
+ consumer = OAuth::Consumer.new(key, secret)
begin
signature = OAuth::Signature.build(request) do
[nil, consumer.secret]
Please sign in to comment.
Something went wrong with that request. Please try again.