marcin
Blog Post: Phoenix auth in 2024: password and provider based auth with phx.gen.auth
Hi! ![]()
I wanted to refresh my knowledge on how to mix phx.gen.auth with local password users db, as well as OAuth providers such as Github, and wrote a guide on this in the end.
Hope it helps in some confusion around the topic I have seen on Elixir Forum!
Most Liked
marcin
@slouchpie thanks for a peer review!
Indeed a grave mistake on my part. Now updated.
slouchpie
A swift and honourable response. You have my respect.
slouchpie
This guide uses :rand.bytes/1 to generate a password.
https://www.erlang.org/doc/apps/stdlib/rand
not cryptographically strong
The auto-generated code they are discussing uses :crypto.strong_random_bytes, just like the erlang docs recommend.
It is easily changed, but this is meant to be an auth guide.
hellosmithy
Thanks for sharing. This is handy - I’m new to Elixir/Phoenix and was a little bewildered by the choice of auth libraries. For now I’ve just been using phx.gen.auth but would like to add social auth at some point so will be referring to this.
hhofner
Not adding much, but I still just want to say great blog, I enjoyed it and found it helpful.







