Sha256: e337ba05cb0da30ec95648d337681f9818cf0d99a4b88d7665b7886965e4b555

Contents?: true

Size: 694 Bytes

Versions: 11

Compression:

Stored size: 694 Bytes

Contents

class GoogleToken < ConsumerToken
  GOOGLE_SETTINGS={
    :site=>"https://www.google.com",
    :request_token_path => "/accounts/OAuthGetRequestToken",
    :authorize_path => "/accounts/OAuthAuthorizeToken",
    :access_token_path => "/accounts/OAuthGetAccessToken",
  }

  def self.consumer
    @consumer||=create_consumer
  end

  def self.create_consumer(options={})
    OAuth::Consumer.new credentials[:key],credentials[:secret],GOOGLE_SETTINGS.merge(options)
  end

  def self.get_request_token(callback_url, scope=nil)
    consumer.get_request_token({:oauth_callback=>callback_url}, :scope=>scope||credentials[:scope]||"http://www-opensocial.googleusercontent.com/api/people")
  end

end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/oauth/models/consumers/services/google_token.rb
panjiva-oauth-plugin-0.4.1 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.5.1 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.5.0 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.1 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0.rc2 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0.rc1 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0.pre7 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0.pre6 lib/oauth/models/consumers/services/google_token.rb
oauth-plugin-0.4.0.pre5 lib/oauth/models/consumers/services/google_token.rb