omniauth-flickr

An Omniauth 1.0 Strategy for Flickr

Basic setup example

  Rails.application.config.middleware.use OmniAuth::Builder do
    provider :flickr, ENV['FLICKR_KEY'], ENV['FLICKR_SECRET'], scope: 'read'
  end

A scope must be set, which translate to the perms parameter in the request url. Valid perms (scopes) are read, write and delete. Info about the authenticated user is fetched from flickr.people.getInfo.

Example AuthHash from a successful authentication:

provider: flickr
uid: 62839091@N05
info: !ruby/hash:OmniAuth::AuthHash::InfoHash
  name: Example User
  nickname: example_user
  ispro: 0
  iconserver: '8061'
  iconfarm: 9
  path_alias: 
  urls: !ruby/hash:OmniAuth::AuthHash
    Photos: !ruby/hash:OmniAuth::AuthHash
      _content: https://www.flickr.com/photos/62839091@N05/
    Profile: !ruby/hash:OmniAuth::AuthHash
      _content: https://www.flickr.com/people/62839091@N05/
  mbox_sha1sum: !ruby/hash:OmniAuth::AuthHash
    _content: f9aa1a7919dea99ba86c773f58381aebc91e333d
  location: !ruby/hash:OmniAuth::AuthHash
    _content: "Åre, Sweden"
  image: http://farm9.static.flickr.com/8061/buddyicons/[email protected]
credentials: !ruby/hash:OmniAuth::AuthHash
  token: 72157650421100317-c02692b6059aa1f3
  secret: 75174bc4da58893a
# ...

For more information see the following:

Release notes:

  • Version 0.0.17

    • better examples and documentation, fix reversed name and nickname (thanks @maxcal)
  • Version 0.0.15

  • Version 0.0.14

    • Use new HTTPS endpoint for API - thanks @rubyonrails3
  • Version 0.0.13

    • better default avatar, thanks to Brainimus
  • Version 0.0.11

    • Fix bugs for users without avatars (thanks viseztrance)
  • Version 0.0.9

    • Allow :scope => 'read' in omniauth setup options
  • Version 0.0.8

    • Use authenticated version of flickr.people.getInfo (contrary to flickr docs, api_key must not be specified on url)
  • Version 0.0.7

    • Documentation and comment change only
  • Version 0.0.6

  • Version 0.0.5

    • Most available user information should now be available in the info hash - Still needs some testing and documentation--to come - Fixed a rescue so it is more contained
  • Version 0.0.4

    • Added more user info explicitly into the info hash
  • Version 0.0.1

    • First cut