yachnytskyi

yachnytskyi

Good tutorials/complex work auth in Elixir/Phoenix

Hello everyone. I am gonna start with Elixir/Phoenix, thinking to use Stephen Grider as a start point, then elixir school and other sources.
What I would like to find. I have been looking for a lot of tutorials, but can’t find something suitable for myself with Guardian or a similar library. I would like to implement a few projects like a blog, chat, etc. I have found already some solutions with building associations, many too many, one too many, direct SQL queries. But auth is a blind point for me. Because I will need not only to setup Guardian (or similar), but also secure my API routes (for example only authorized users can post messages, posts, comments, etc). Or a user must be authorized to watch their own messages. Sure I can just ignore auth now, but would like to start with it as well. Would be grateful for any help.

Most Liked

yachnytskyi

yachnytskyi

Guys thanks you very much, appreciate your help. I will do it according to your recommendations. I really see that Elixir community is really friendly! Hope it’s also possible to find a job there with general background from Golang, Python and other languages.

D4no0

D4no0

I would recommend you to read on how Plugs work, once you understand that, you can simply read on how to use Guardian, either as a plug, or custom functionality inside your own custom plug.

al2o3cr

al2o3cr

None of the things you’ve described require Guardian.

I recommend starting with phx.gen.auth and writing straightforward code in your controllers / LiveViews to check “is there a user?” etc. When/if that starts to feel too complicated, then start looking for additional libraries; you’ll know what you need a lot better at that point.

derpycoder

derpycoder

I was in your shoes, a while back, until I found this comprehensive tutorial on approaching Authorization:

https://www.leanpanda.com/blog/authentication-and-authorisation-in-phoenix-liveview/


There’s no shortcut, no library can save you.

Just learn from the above tutorial, and then take it further as per your requirements.

I put some of my thoughts on this, in another thread:

Where Next?

Popular in Chat/Questions Top

ariandanim
Hello all, I am still learning Elixir, then go into Phoenix, i am try search in google but find the programming phoenix 1.4, another for...
New
xgilarb
Hi there, I’m interested in using Elixir because of the rumors about the reliability of the Phoenix framework, and surprisingly, Elixir’...
New
wolfiton
Hi everyone, How can i retrieve the name from a structure like this? %{"id" => "1570", "name" => "Croque Monsieur"} My test loo...
New
Emily
Preface: I’m not sure if thise is the right place, because this is not direclty Elixir related… but I’ve always got some of the best advi...
New
jsnoble
I come from a javascript background and I just starting learning elixir. I went through the basic tutorials but I want something deeper. ...
New
Fl4m3Ph03n1x
Background I am trying to recycle myself and improve my knowledge about Phoenix. With 1.7 now out, this seems like a good opportunity. W...
New
Nvim
Anybody know of a Pragmatic Studio 40% off coupon code for video course like Phoenix?
New
phykos
In Ruby, which is very similar to Elixir I do this: def test yield end test do puts("sup there") end Here, the yield keyword will be...
New
QueenSvetlana
My bookstore has Introducing Elixir: Getting Started In Functional Programming and the front cover says the book uses Elixir 1.4. The cur...
New
SavagePixie
I was wondering if there are any beginner-friendly, exercise-based resources for learning Elixir out there. I’m looking for something lik...
New

Other popular topics Top

bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement