Guardian is an authentication library for Elixir applications that uses token-based authentication with JSON Web Tokens by default.
Guardian solves the problem of implementing authentication across diverse Elixir systems by providing a flexible token-based approach. The library treats tokens as its core currency and supports JWT out of the box, but allows developers to implement custom token types by adhering to the Guardian.Token behaviour. Tokens can carry arbitrary claims and assertions, both standard and application-specific. The tool integrates with Plug and Phoenix but operates independently of them, making it usable in TCP/UDP protocols, Phoenix channels, or any system where authentication tokens can be attached.
Developers should choose Guardian if they need authentication that works across multiple contexts within a single Elixir application, including web endpoints, channels, and custom protocols. The library's support for multiple token types and configurations in one application suits projects with complex authentication requirements. Guardian's flexibility in token implementation means it can adapt to different security needs rather than forcing a single approach.
The project maintains active test coverage and inline documentation. Development activity shows consistent attention to code quality and API stability.