A comprehensive, framework-agnostic authentication and authorization library for Go.
✨ Overview
GoBetterAuth is a comprehensive, authentication and authorization library/framework for Go applications. It provides secure email/password authentication, session management, email verification, password reset, and more, all built with clean architecture.
💭 Why GoBetterAuth?
GoBetterAuth is designed to be a comprehensive authentication and authorization solution for Go applications. It simplifies the implementation of common security features while providing a clean and modular architecture. This way developers can focus on building their applications without worrying about the complexities of authentication and the time it takes to implement these features.
- 🔑 Email & Password – Secure, production-ready authentication with argon2 password hashing. Includes Email Verification, Password Reset and Change Email flows.
- 🌐 Social OAuth Providers – Google, GitHub, Discord and more coming soon.
- 💾 Multiple Database Support – SQLite, PostgreSQL, MySQL adapters and more coming soon, with migration scripts included.
- 🗄️ Secondary Storage – Supports in-memory/database storage and a custom interface to implement Redis and other key-value stores. Use secondary storage to manage session data, rate limiting counters, and other high-frequency records. This enables offloading intensive data to high-performance storage solutions or RAM for optimal scalability and speed.
- 📦 Minimal Dependencies – Standard library first, production-ready, and framework-agnostic.
- 🧩 Comprehensive Configuration – Flexible, type-safe config with sensible defaults and environment variable support.
- 🛡️ Enhanced Security – CSRF protection.
- ⚡ Rate Limiting – Configurable rate limiting with secondary storage.
- 📨 Event Bus – Built-in event bus enables event-driven architecture, allowing you to publish and subscribe to authentication and authorization events for seamless integration with external systems and custom workflows.
- 🔌 Plugin System – Extensible plugin architecture for custom business logic and routes. Including flexible plugin interface to implement all kinds of plugins.
For more info and a full guide on how to use this library, check out the Docs.
Your contributions are welcome! Here's how you can get involved:
- If you find a bug, please submit an issue.
- Set up your development environment by following our Contribution Guide.
- Contribute code by making a pull request to enhance features, improve user experience, or fix issues.
