Sha256: affa63c34dfdd466788ce47c2ebef7d42edd11fb266087f544d5158c3c965a81
Contents?: true
Size: 831 Bytes
Versions: 12
Compression:
Stored size: 831 Bytes
Contents
require 'linkedin' class LinkedinToken < ConsumerToken LINKEDIN_SETTINGS={ :site => "https://api.linkedin.com", :request_token_path => "/uas/oauth/requestToken", :access_token_path => "/uas/oauth/accessToken", :authorize_path => "/uas/oauth/authorize" } def self.consumer @consumer ||= create_consumer end def self.create_consumer(options={}) OAuth::Consumer.new(credentials[:key], credentials[:secret], LINKEDIN_SETTINGS.merge(options)) end def self.get_request_token(callback_url) consumer.get_request_token({ :oauth_callback => callback_url }) end def client unless @client @client = ::LinkedIn::Client.new(LinkedinToken.consumer.key, LinkedinToken.consumer.secret) @client.authorize_from_access(token, secret) end @client end end
Version data entries
12 entries across 12 versions & 1 rubygems