7

I was creating a webapp in phoenix, I was wondering what could be a better way to implement user registration/authentication and session management in it.

On googling I found these two libraries: addict and passport

But I am not sure how much stable are these and are they being used in production somewhere. Please let me know if there are some libraries safe to use in production and if there are some example implementation of those.

Saurabh
  • 58,805
  • 34
  • 169
  • 222

3 Answers3

9

Addict seems to be the more mature project and appears to be "the one" right now. In order to find good Elixir libraries, I always like to consult the Awesome Elixir Github repo.

Patrick Oscity
  • 49,954
  • 15
  • 127
  • 157
0

I think at this point it's easier to implement it yourself. It should not take you long if you're comfortable with elixir and know phoenix's basics. There is nothing difficult about it

NoDisplayName
  • 13,743
  • 10
  • 54
  • 90
  • Are there are some example implementation of this. – Saurabh Oct 02 '15 at 07:05
  • 1
    @saurabh I am not sure. If you know ruby, you could probably check out the gem called `sorcery`, it's a pretty simple gem that might help you figure out how some things work and implement those in Elixir. But it's really simply to do it from scratch. `Phoenix` helps you to work with cookies, `comeonin` or some other hex package will help you with password hashing, `Ecto` will help you with validations and that's most of what you'll probably need – NoDisplayName Oct 02 '15 at 15:25
  • here you have a railscast where user authentication is being implemented from scratch: http://railscasts.com/episodes/250-authentication-from-scratch I hope it helps! – nisevi May 26 '16 at 18:06
  • 1
    And also this -> https://stackoverflow.com/questions/549/the-definitive-guide-to-form-based-website-authentication should be helpful as well. – NoDisplayName May 27 '16 at 02:43
  • 2
    This is just terrible advice. Indeed, we should learn how to do it ourselves, but we should aim to build a reusable library that is both safe and tested. He really needs to know which of the two is better. – frostymarvelous Jul 11 '16 at 14:22
  • @frostymarvelous Well, I am sure there were a lot of safe, well tested and flexible elixir libraries at the time of writing this answer. – NoDisplayName Jul 11 '16 at 19:54
  • @saurabh If you wish to implement authentication yourself, I have written a how-to article on it: http://nithinbekal.com/posts/phoenix-authentication/ – Nithin Nov 18 '16 at 14:57
  • Maybe it doesn't make sense to do it now in 2017 if there are some good stable libraries out there. But when I first wrote it, there wasn't so there is no reason to downvote it. – NoDisplayName Feb 09 '17 at 15:04
-2

If you're rolling your own you might be interested in the Episode 3 and 5 of https://phoenixscreencasts.com/

(Note that they require a paid subscription)

EDIT: The site has been shut down by the author, this is no longer a valid response.

Steve D.
  • 39
  • 1
  • 8