{"id":16747829,"url":"https://github.com/janko/flickr-login","last_synced_at":"2025-06-24T13:05:22.195Z","repository":{"id":4386876,"uuid":"5523817","full_name":"janko/flickr-login","owner":"janko","description":"A gem that provides Flickr authentication.","archived":false,"fork":false,"pushed_at":"2012-12-27T13:41:32.000Z","size":104,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-20T02:37:35.540Z","etag":null,"topics":["authentication","flickr","login","rack","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-23T10:24:57.000Z","updated_at":"2025-01-03T13:33:08.000Z","dependencies_parsed_at":"2022-09-17T17:03:17.519Z","dependency_job_id":null,"html_url":"https://github.com/janko/flickr-login","commit_stats":null,"previous_names":["janko-m/flickr-login"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janko%2Fflickr-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janko%2Fflickr-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janko%2Fflickr-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janko%2Fflickr-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janko","download_url":"https://codeload.github.com/janko/flickr-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818205,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","flickr","login","rack","ruby"],"created_at":"2024-10-13T02:11:01.325Z","updated_at":"2025-03-16T03:10:31.588Z","avatar_url":"https://github.com/janko.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flickr Login\n\n## About\n\nThis gem is a simple Rack endpoint that provides Flickr authentication in your\nweb application. You just mount it on your web application and it does the rest of the work.\n\nThis gem is an alternative to [omniauth-flickr](https://github.com/timbreitkreutz/omniauth-flickr).\nThey both provide similar results, the main difference is that `flickr-login` is much more\nlightweight. If you don't care about that, I would highly suggest that you go with\n`omniauth-flickr`, because `omniauth` is a great standard for authentication.\n\nIf you intend to use the user's access token for communication with Flickr's\nAPI, you'll want to use one of these 2 gems:\n\n- [flickraw](https://github.com/hanklords/flickraw)\n- [flickr-objects](https://github.com/janko-m/flickr-objects)\n\n## Installation\n\nPut it into your Gemfile:\n\n```ruby\ngem \"flickr-login\", require: \"flickr/login\"\n```\n\nAnd run `bundle install`.\n\n## Setup\n\nYou have to be in possession of your API key and shared secret. If you don't have them yet,\nyou can apply for them [here](http://www.flickr.com/services/apps/create/apply).\nIn the setup, just replace `API_KEY` and `SHARED_SECRET` with real values.\n\n### Rails\n\nThis is an example of how you can the gem in **Rails 3** (in Rails 2 it's probably\nsimilar).\n\n```ruby\n# config/application.rb\nmodule YourApp\n  class Application \u003c Rails::Application\n    # ...\n    config.flickr_login = Flickr::Login.new \"API_KEY\", \"SHARED_SECRET\"\n    # ...\n  end\nend\n```\n```ruby\n# config/routes.rb\nYourApp::Application.routes.draw do\n  # ...\n  flickr = YourApp::Application.config.flickr_login\n  flickr_endpoint = flickr.login_handler(return_to: \"/any-path\")\n\n  mount flickr_endpoint =\u003e '/login', as: :login\n  # ...\nend\n```\n\n### Sinatra\n\nIn Sinatra this is being put in your `config.ru`, which probably looks\nsomething like this:\n\n```ruby\n# config.ru\nrequire './app'\nrun Sinatra::Application\n```\n\nNow you mount the Rack endpoint like this\n\n```ruby\n# config.ru\nrequire './app'\nrequire 'flickr/login'\n\nflickr = Flickr::Login.new \"API_KEY\", \"SHARED_SECRET\"\nflickr_endpoint = flickr.login_handler(return_to: \"/any-path\")\n\nuse Rack::Session::Cookie\nrun Rack::URLMap.new \"/\" =\u003e Sinatra::Application,\n                     \"/login\" =\u003e flickr_endpoint\n```\n\nThat's it. Just enable sessions in your `app.rb`:\n\n```ruby\n# app.rb\nenable :sessions\n```\n\n## What it does\n\nThe user will first get redirected to Flickr to approve your application. The\nuser is then redirected back to your app (back to the path specified with `:return_to`),\nwith `session[:flickr_access_token]` and `session[:flickr_user]` filled in.\n\n- `session[:flickr_access_token]` – an array of access token and access secret\n- `session[:flickr_user]` – a hash of information about the authenticated user\n\n## Configuration\n\nAvailable options for `Flickr::Login` are:\n\n- `:return_to` – where the user is redirected to after authentication (defaults to `\"/\"`)\n- `:site` – the API endpoint that is used (defaults to [http://www.flickr.com/services](http://www.flickr.com/services))\n\nYou can also set the permissions you're asking from the user. You do this by passing the\n`perms` GET parameter in the URL. For example, going to `http://localhost:9393/login?perms=delete`\nwould ask the user for \"delete\" permissions. You can ask the user for \"read\", \"write\" or \"delete\" permissions.\n\n## Helpers\n\nThe `Flickr::Login::Helpers` module adds these methods to your app:\n\n- `#flickr_user` (Hash) – The information about the user who just authenticated\n- `#flickr_access_token` (Array) – The access token and secret\n- `#flickr_clear` – Erases the session that was filled after authentication, effectively logging out the user\n\nIn **Rails** you can include the module in your controller:\n\n```ruby\n# app/controllers/session_controller.rb\nclass SessionController \u003c ApplicationController\n  include Flickr::Login::Helpers\nend\n```\n\nIn **Sinatra** you can just call the `helpers` method:\n\n```ruby\nhelpers Flickr::Login::Helpers\n```\n\n## Credits\n\nThis gem is almost a direct copy of **@mislav**'s [twitter-login](https://github.com/mislav/twitter-login)\nand [facebook-login](https://github.com/mislav/facebook) gems.\n\n## License\n\n[MIT](https://github.com/janko-m/flickr-login/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanko%2Fflickr-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanko%2Fflickr-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanko%2Fflickr-login/lists"}