marcin

marcin

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

Hi! :waving_hand:
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.

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.

Where Next?

Popular in Blog Posts Top

tmartin8080
Sharing some articles I’ve written recently while working in Elixir. Some are how-to guides and others for reference. Will update this ...
New
New
Paradox
Testing is an important part of any modern piece of software. But writing tests can quickly become an exercise in frustration, with tons ...
New
AstonJ
Elixir Blog Posts How to use this section You can post links to your blog posts either in one of the Official Blog Posts threads, or, vi...
New
lawik
We all have varying degrees of exposure to Big Tech. Some of it seems fine, stable and can be relied on. Some of it feels like shifting s...
New
gaggle
This post explores different ways to do test automation in Elixir, focusing on how to handle dependency injection — covering patterns, li...
New
brainlid
You are storing some Phoenix LiveView state in the browser. You want to retrieve that saved state as early as possible to improve the use...
New
ConnorRigby
Just finished a post for Embedded Elixir and I thought it should be cross-posted here: https://embedded-elixir.com/post/2018-09-25-mocks...
New
mudasobwa
Blogged about the motivation and reasoning behind my idea to create yet another FSM library. Long story short: I did it in a proper way :...
New
paulanthonywilson
I had a bit of a mini-adventure following Sobelow’s advice on adding a CSP to a Phoenix App. If you want to follow along, or want to add ...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
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
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

We're in Beta

About us Mission Statement