yachnytskyi

yachnytskyi

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.

Showing Posts 1 to 6

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:

yachnytskyi

yachnytskyi OP

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.

nevakrien

nevakrien

is there something that also shows how acount crreation/delision should be made?
I am brand new to webdev and elixir and this sort of thing is difficult for me

KP123

KP123

Basic auth is provided by phoenix

— All posts loaded —

Where Next? Top

Trending in Chat/Questions Top

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews