GithubHelp home page GithubHelp logo

christopheradams / ueberauth_flickr Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 32 KB

Flickr Strategy for Überauth

License: MIT License

Elixir 100.00%
elixir flickr flickr-api oauth plug ueberauth ueberauth-strategies

ueberauth_flickr's Introduction

Überauth Flickr

Flickr strategy for Überauth.

Note: Sessions are required for this strategy.

Install the latest version of Überauth Flickr from https://hex.pm/packages/ueberauth_flickr

Documentation is available at http://hexdocs.pm/ueberauth_flickr

Source code is available at https://github.com/christopheradams/ueberauth_flickr

Installation

  1. Create an application at Flickr App Garden.

  2. Add :ueberauth_flickr to your list of dependencies in mix.exs:

    def deps do
      [{:ueberauth_flicker, "~> 0.3"}]
    end
  3. Add the strategy to your applications:

    def application do
      [applications: [:ueberauth_flickr]]
    end
  4. Add Flickr to your Überauth configuration:

    config :ueberauth, Ueberauth,
      providers: [
        flickr: {Ueberauth.Strategy.Flickr, []}
      ]
  5. Update your provider configuration:

    config :ueberauth, Ueberauth.Strategy.Flickr.OAuth,
      consumer_key: System.get_env("FLICKR_CONSUMER_KEY"),
      consumer_secret: System.get_env("FLICKR_CONSUMER_SECRET")
  6. Include the Überauth plug in your controller:

    defmodule MyApp.AuthController do
      use MyApp.Web, :controller
    
      plug Ueberauth
    end
  7. Create the request and callback routes if you haven't already:

    scope "/auth", MyApp do
      pipe_through :browser
    
      get "/:provider", AuthController, :request
      get "/:provider/callback", AuthController, :callback
    end
  8. Your controller needs to implement callbacks to deal with Ueberauth.Auth and Ueberauth.Failure responses.

For an example implementation see the Überauth Example application.

Calling

Depending on the configured url you can initiate the request through:

/auth/flickr

Or with options:

/auth/flickr?perms=delete

By default the permissions are the ones defined in your application authentication flow on Flickr. To override them, set a perms query value on the request path or in your configuration. Allowed values are "read", "write", or "delete".

config :ueberauth, Ueberauth,
  providers: [
    flickr: {Ueberauth.Strategy.Flickr, [default_perms: "delete"]}
  ]

License

Please see LICENSE for licensing details.

ueberauth_flickr's People

Contributors

christopheradams avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.