Class: OmniAuth::Strategies::Flickr
- Defined in:
- lib/omniauth/strategies/oauth/flickr.rb
Instance Attribute Summary
Attributes inherited from OAuth
#consumer_key, #consumer_options, #consumer_secret, #name
Instance Method Summary collapse
- #auth_hash ⇒ Object
-
#initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) ⇒ Flickr
constructor
A new instance of Flickr.
- #user_info ⇒ Object
Methods inherited from OAuth
#callback_phase, #consumer, #request_phase, #unique_id
Constructor Details
#initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) ⇒ Flickr
Returns a new instance of Flickr.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/omniauth/strategies/oauth/flickr.rb', line 8 def initialize(app, consumer_key=nil, consumer_secret=nil, ={}, &block) scope = .delete(:scope) || 'read' [:authorize_params] ||= {} [:authorize_params][:perms] = scope = { :access_token_path => "/services/oauth/access_token", :authorize_path => "/services/oauth/authorize", :request_token_path => "/services/oauth/request_token", :site => "http://www.flickr.com" } super(app, :flickr, consumer_key, consumer_secret, , , &block) end |
Instance Method Details
#auth_hash ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/omniauth/strategies/oauth/flickr.rb', line 22 def auth_hash OmniAuth::Utils.deep_merge( super, { 'uid' => @access_token.params["user_nsid"], 'user_info' => user_info } ) end |
#user_info ⇒ Object
31 32 33 34 35 36 |
# File 'lib/omniauth/strategies/oauth/flickr.rb', line 31 def user_info { 'username' => @access_token.params["username"], 'full_name' => @access_token.params["fullname"] } end |