marcin

marcin

Blog Post: Phoenix auth in 2024: password and provider based auth with phx.gen.auth

Hi! :wave:
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

marcin

@slouchpie thanks for a peer review! :clap: Indeed a grave mistake on my part. Now updated.

slouchpie

slouchpie

A swift and honourable response. You have my respect.

slouchpie

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

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

hhofner

Not adding much, but I still just want to say great blog, I enjoyed it and found it helpful.

Where Next?

Popular in Blog Posts Top

sheharyarn
In this article, I talk about the Elixir library Delta we at Slab just open-sourced, its various features including support for Operation...
New
axelson
I describe how we use Hot Reloading with Webpack to develop faster and show how to integrate Webpack 5, webpack-dev-server, and Phoenix f...
New
brainlid
Building a LiveView powered chat app is easier than ever when using Streams! Sophie DeBenedetto shows us how in this article. She createa...
New
paulanthonywilson
All a bit meta, but this is a quick post on creating a Jekyll blog post from a Livebook page. Posted via Devtalk (see this thread for ...
New
adolfont
Hi, You all probably know that José Valim is Brazilian and that his native language is Portuguese. I, Herminio Torres, Matheus Pesanha a...
New
ryotsu
How does a torrent client download huge files from the internet with just a .torrent file? In this post we’ll explore the BitTorrent prot...
New
New
DevotionGeo
There are 3 main formatters for Erlang which you can use from the command-line, rebar3_format, Steamroller elmfmt. Visual Studio Cod...
New
mssantosdev
Our take on how to build a frontend style guide with Phoenix Components, Atomic Design and plain CSS, with focus on reusability and code ...
New
SmartLogic
Season four of the Elixir Wizards podcast launches today! This season we’re focused on system and application architecture. We’ll be doin...
New

Other popular topics Top

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
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
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
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement