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.

Last Post!

KP123

KP123

Basic auth is provided by phoenix

Where Next?

Popular in Chat/Questions Top

pillaiindu
I am a VSCode and Sublime user and I know VIM, though I don’t use VIM directly but whenever I code inside Sublime or VSCode, I use Vim em...
New
Lincxx
Hello, I’m sure this has been asked a bunch, but where to start. I do prefer vodeos over books, but recently I have found books to be mor...
New
Fl4m3Ph03n1x
Background After following the communitiy suggestion, I bought the Elixir in Action 2nd Edition book and I am about to finish it now. I ...
New
pietrofxq
I’ve bought the following books: Programming Elixir 1.6 Programming Phoenix 1.4 Programming Ecto Functional Web Development with Elixir...
New
InkFlo
Hi everyone, This year I’m graduated from Bachelor Degree (in computer science) from France (not really a bachelor, the exact term is “L...
New
satoru
I’m working on the “Bob” exercise on the Elixir Track in Exercism. I am testing for uppercase letter with this simple check: c in ?A..?Z...
New
shansiddiqui94
Hello all, I recently did my first app in Phoenix and Liveview, many thanks to all the users who assisted me. I found that the tutorial ...
New

Other popular topics Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44167 214
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement