Giter Club home page Giter Club logo

passport's Introduction

Passport

Experimental.

Passport is an easy to use Authentication library for Phoenix 1.3.

Passport is rewritten to make use of the context design pattern of Phoenix 1.3.

Passport organises the code in your project in the directory lib/your_app/auth

Installation and Usage

  1. Add passport to your list of dependencies in mix.exs:

    def deps do [{:passport, git: "https://github.com/opendrops/passport.git"}] end

  2. $ mix do deps.get, compile

  3. $ mix passport.setup

  4. Follow the instruction displayed on screen.

State of development

This project is currently under development. Though it works, there are a lot of scope for improvement and not thoroughly tested. My goal is to make Passport a solid library for authentication. See the issues queues for the list of tasks to be done.

License

Passport is Copyright ยฉ 2017 Opendrops. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

About Opendrops

Opendrops

Passport is maintained and funded by Opendrops. We love open source software! If you have a project in Elixir or Ruby, get in touch with us.

passport's People

Contributors

bagilevi avatar barberj avatar barttenbrinke avatar cloudbring avatar hikeeba avatar iaddict avatar joenorth avatar pauloancheta avatar shankardevy avatar toraritte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passport's Issues

Fix Build Badge: Currently Unknown

Build Status

Currently that's unknown. It should say either pass or fail. I'd be interested in investigating it eventually if no one else has the time to setup up.

mix passport.setup not working

When running $ mix passport.setup after adding the dependency and running mix do deps.get, compile

I get:

** (UndefinedFunctionError) function Mix.Tasks.Phx.Gen.Html.build/1 is undefined or private
    Mix.Tasks.Phx.Gen.Html.build(["Account", "User", "users"])
    lib/mix/tasks/passport.setup.ex:23: Mix.Tasks.Passport.Setup.generate_account/1
    lib/mix/tasks/passport.setup.ex:13: Mix.Tasks.Passport.Setup.run/1
    (mix) lib/mix/task.ex:301: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:75: Mix.CLI.run_task/2

mix phx.gen.html works as expected. I am running phoenix 1.3.0.

Installation issue with Phoenix 1.3.0-RC

Hi there,

I'm attempting to follow Passport's installation instructions for use with Phoenix 1.3.0-RC as per the readme, however get stuck at the last step:

> mix passport.setup

** (UndefinedFunctionError) function Mix.Tasks.Phx.Gen.Html.build/1 is undefined or private
    Mix.Tasks.Phx.Gen.Html.build(["Account", "User", "users"])
    lib/mix/tasks/passport.setup.ex:23: Mix.Tasks.Passport.Setup.generate_account/1
    lib/mix/tasks/passport.setup.ex:13: Mix.Tasks.Passport.Setup.run/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

Any ideas on what the above means?
I'm an Elixir newbie using Elixir 1.4.2 and {:phoenix, "~> 1.3.0-rc"}.
Help appreciated! ๐Ÿ‘

Redo Passport ground up

Passport should care only about one thing: authentication. Existing libraries try to do more than that which is imposing a few limitations in some of the projects I work with. I plan to do a complete authentication framework for Phoenix using Passport. Passport will be accompanied by Visa that can allow multiple roles per user. This issue is to track to many related ones that I consider as important before releasing a stable v1.

Hex dependency resolution failed

Trying to add passport in my test project, but I get error message:

Looking up alternatives for conflicting requirements on phoenix_ecto
  Activated version: 1.2.0
  From mix.exs: ~> 1.1
  From mix.lock: 1.2.0
  From passport v0.0.3: ~> 0.2

** (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies

Get the current user in controller

I have a phoenix collection which has a relation :belongs_to :user. When creating a new record, I want to get the current user's ID inside the create action of my controller, and modify the changeset accordingly.

How do I get the current User's ID? Passport itself seems to work fine, with registration and so on. Any ideas?

Consider moving options out of configuration

I'm proposing the repo and user model be moved out of configuration and into plug options. The way things are now, the configuration is global where instead it could provided to the controller or auth plug as plug options and referenced off the connection instead. I would also recommend renaming user_class to something more functional :)

Version on Hex out of date

The version on Hex right now is missing Passport.AuthenticationPlug. Maybe bump versions and republish?

undefined funciton nil.get_by/2

when trying to login I get this

[error] #PID<0.525.0> running Scotchy.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /login
** (exit) an exception was raised:
    ** (UndefinedFunctionError) undefined function nil.get_by/2
        nil.get_by(nil, [email: "*****"])
        lib/passport/session.ex:17: Passport.Session.login/3
        (scotchy) web/controllers/session_controller.ex:14: Scotchy.SessionController.create/2
        (scotchy) web/controllers/session_controller.ex:1: Scotchy.SessionController.action/2
        (scotchy) web/controllers/session_controller.ex:1:     Scotchy.SessionController.phoenix_controller_pipeline/2
        (scotchy) lib/phoenix/router.ex:261: Scotchy.Router.dispatch/2
        (scotchy) web/router.ex:1: Scotchy.Router.do_call/2
        (scotchy) lib/scotchy/endpoint.ex:1: Scotchy.Endpoint.phoenix_pipeline/1
        (scotchy) lib/plug/debugger.ex:93: Scotchy.Endpoint."call (overridable 3)"/2
        (scotchy) lib/phoenix/endpoint/render_errors.ex:34: Scotchy.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Not sure what the issue is, i followed the setup instructions

Example app?

Any chance of filling out the example, I like the simplicity of what you've got so far here, but I'm having trouble getting it functional - seeing how you've done it would help a lot.

Provide a generator for passport install

A command to generate passport related controllers, model, views and templates
mix passport.install User

This should provide routes for common user actions like registration, sign in, sign out etc.

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.