β¨ Overview
Authula is an open-source authentication solution that scales with you. Embed it as a library in your Go app, or run it as a standalone auth server with any tech stack. It simplifies adding robust authentication to backend services, empowering developers to build secure applications faster.
All functionality is delivered through a powerful plugin system, allowing you to compose exactly the authentication stack you need β no more, no less, all built with clean architecture. Authula is flexible enough to integrate with any technology stack. It streamlines the implementation of essential security features through a clean, modular architecture, allowing developers to concentrate on building their applications without the overhead of managing authentication complexities.
Authula is ideal for:
- Startups that want full control over their authentication stack
- Teams building microservices or multi-backend systems
- Companies with self-hosting or compliance requirements
- Go developers who want first-class embedded auth
- Anyone who wants modern auth without SaaS lock-in
π§© Plugins & Capabilities
Authula is architected around a powerful plugin and capability system.
Plugins are modular packages that encapsulate related authentication features.
Capabilities represent individual, fine-grained functionalities exposed by these plugins.
Each plugin can offer multiple capabilities, and every route in your application explicitly declares which capabilities it leverages. This approach ensures that authentication logic is:
- Explicit β No hidden behaviors; every capability is clearly declared.
- Composable β Mix and match only the features you need.
- Auditable β Easily track which routes use which authentication features.
- Understandable β The authentication flow is transparent and easy to reason about.
This design empowers you to build secure, maintainable, and highly customizable authentication flows tailored to your application's needs.
Authula comes with a variety of plugins that provide essential authentication features out of the box:
- π§ Email & Password: Authentication, Email Verification & Password Reset
- π OAuth providers
- π TOTP: Authenticator app support, backup codes, trusted devices for two-factor authentication
- πΎ Multiple database backends
- ποΈ Secondary storage (Redis, memory, DB)
- β‘ Rate limiting
- π‘οΈ CSRF protection
- πͺ Hooks system
- π¨ Event bus
- π§© Custom routes and logic
Authula includes a powerful, lifecycle-based hooks system that lets you intercept and customize request handling at every stage of the HTTP pipeline.
Hooks allow you to implement:
- custom authentication logic
- request validation
- logging & tracing
- metrics
- access control
- A/B testing
- feature flags
- audit trails
- custom headers
- dynamic routing
All without modifying core code.
Build your own plugins for:
- business logic
- custom routes
- custom auth flows
- external integrations
- internal tooling
Embedded Mode (Go Library)
Embed Authula directly into your Go application:
import (
authula "github.com/Authula/authula"
authulaconfig "github.com/Authula/authula/config"
authulamodels "github.com/Authula/authula/models"
authulaenv "github.com/Authula/authula/env"
)
config := authulaconfig.NewConfig(
authulaconfig.WithAppName("AuthulaPlayground"),
authulaconfig.WithBasePath("/api/auth"),
authulaconfig.WithDatabase(authulamodels.DatabaseConfig{
Provider: "postgres",
URL: os.Getenv(authulaenv.EnvDatabaseURL),
}),
// other config options...
)
auth := authula.New(authula.AuthConfig{
Config: config,
Plugins: []authulamodels.Plugin{
emailpasswordplugin.New(...),
// other plugins...
},
})
http.ListenAndServe(":8080", auth.Handler())You get:
- zero network overhead
- full type safety
- native integration
- maximum performance
Standalone Mode
Run Authula as a standalone authentication server via Docker:
docker run -itd -p 8080:8080 \
-v $(pwd)/config.toml:/home/appuser/config.toml \
-e AUTHULA_BASE_URL=http://localhost:8080 \
-e AUTHULA_SECRET=my-app-secret \
-e AUTHULA_DATABASE_URL=<your_connection_string> \
# other env vars depending on plugins used...
ghcr.io/authula/authula:latestUse it from any language or framework over HTTP.
- Plugin-first architecture
- Clean architecture
- Minimal dependencies
- Standard library first
- Secure by default
- Framework agnostic
- Self-hosted
- Extensible
For more info and a full guide on how to use this library, check out the Docs.
We provide the following SDKs to facilitate easy integration with Authula:
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.
Join our growing community for support, discussions, and updates:
If you'd like to support the ongoing development of this project, consider subscribing on Polar, it means a lot to me!
