gdelazzer

gdelazzer

How do you build authentication in your Phoenix project in 2024?

Hi all,

If you were to start a new project today that requires a standard user/password authentication, PasswordLess (Magic Link) and a couple of social auth (Google and Facebook), which direction would you take?

  • Using a library such as uberauth or pow (or other)? why?
  • Use Assent with phx_gen_auth and do the plumbing yourself?
  • Build everything by yourself?
  • Any other solution that I am not seeing?

Bonus point if you have resources (blog posts/yt/books) talking about this :slight_smile:

Based on the articles I have found so far, and on what I read in several forums, phx_gen_auth + Assent + plumbing might be the “easiest” in the long term as I would have more control over my code?

Here are 2 articles that seem interesting and are pushing me in that direction:

Phoenix auth in 2024: password and provider based auth

and

How To Add Magic Link Login to a Phoenix LiveView App

Thank you in advance for your opinions and help!

PS: If I was brave enough I would add “Authorization” to this question, but let’s keep this for an other thread later :slight_smile:

Most Liked

gushonorato

gushonorato

I recently open-sourced a library designed to make authentication effortless. It’s called Magic Auth, and it’s tailored to help developers set up authentication quickly and easily.

This library is particularly useful for rapid prototyping and building MVPs, but it’s also robust enough for use in production applications. The main goal of Magic Auth is to enable everyone to configure authentication in less than 5 minutes, streamlining the process and saving valuable development time.

You can also check out the presentation post here: Magic Auth - An Phoenix Authentication Library Designed for Effortless Setup 🚀.

I hope you find it helpful!

woylie

woylie

I built an identity provider this year with passwords, passkeys, OIDC (Google/Apple), TOTP, recovery codes, and support for multiple email addresses per user. I chose phx.gen.auth, ueberauth, nimble_totp, and wax. I was already familiar with phx.gen.auth and ueberauth, and I felt this choice would give me a great level of flexibility and control. Magic links should be fairly easy to add to the application, if needed in the future. I haven’t worked with pow or assent before, though.

Hermanverschooten

Hermanverschooten

I would love to see you how you did that

Where Next?

Popular in Questions Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54120 245
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement