Class: OmniAuth::Strategies::Flickr

Inherits:
OAuth
  • Object
show all
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

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, options={}, &block)
  scope = options.delete(:scope) || 'read'
  options[:authorize_params] ||= {}
  options[:authorize_params][:perms] = scope

  client_options = {
    :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, client_options, options, &block)
end

Instance Method Details

#auth_hashObject



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' => 
    }
  )
end

#user_infoObject



31
32
33
34
35
36
# File 'lib/omniauth/strategies/oauth/flickr.rb', line 31

def 
  {
    'username' => @access_token.params["username"],
    'full_name' => @access_token.params["fullname"]
  }
end