Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

How to authenticate Phoenix with Guardian

Blog post from LogRocket

Post Details
Company
Date Published
Author
Simon Bundgaard-Egeberg
Word Count
1,876
Language
-
Hacker News Points
-
Summary

The tutorial provides a comprehensive guide on setting up authorization in an Elixir project using Guardian and JWTs, utilizing Phoenix v1.7 and Phoenix LiveView v0.18 to scaffold the necessary authentication and authorization code. It details the creation of modules and endpoints that interface with Guardian to generate and verify JWTs, allowing for secure access to app resources based on user credentials and roles, such as distinguishing admin users from regular users. The tutorial emphasizes the use of plug pipelines to manage user information retrieval and access control via JWTs, enhancing the security and scalability of the application. Additionally, it suggests utilizing third-party authentication providers like Auth0 for more robust user authentication management, while providing practical examples of endpoint creation and JWT handling within the Phoenix framework.