Repo of the Day
thecodearcher/limen: Modern, composable authentication for Go
Published: Nov 26, 2026
Open repository ↗Modern, composable authentication for Go. Contribute to thecodearcher/limen development by creating an account on GitHub.
Summary
Limen is a modular authentication library for Go, with authentication methods packaged as separate plugins rather than bundled into the core. It provides credential/password authentication, OAuth 2.0, two-factor authentication, and session management while allowing applications to choose their own database adapter and web framework.
What it is useful for
Limen is useful when a Go service needs an authentication layer that can be assembled around existing application choices. The core contains interfaces, session management, and security primitives; teams add only the authentication methods and adapters they need. For example, a standard net/http service can use the GORM adapter and credential/password plugin, while projects using another database or framework can supply or select a more appropriate integration.
This separation is helpful for applications that do not want every authentication flow and its dependencies included by default. It also provides a path to compose different requirements over time—for example, starting with password-based sign-in and adding OAuth providers or two-factor authentication through additional modules. The repository includes examples covering OAuth providers, two-factor authentication, and Gin integration.
Limen requires Go 1.25 or newer. It is not a complete application framework: the project expects engineers to bring their own database and framework, and each authentication method is installed separately.
How engineers can use it
Install the core module:
go get github.com/thecodearcher/limen
Then add the adapter and plugins required by the application. The documented GORM and credential/password setup is:
go get github.com/thecodearcher/limen/adapters/gorm
go get github.com/thecodearcher/limen/plugins/credential-password
In the README’s quick start, an engineer creates a Limen instance with a base URL, database adapter, signing secret, and selected plugins:
auth, err := limen.New(&limen.Config{
BaseURL: "http://localhost:8080",
Database: gormadapter.New(db),
Secret: []byte("your-32-byte-secret-key-here!!!!"),
Plugins: []limen.Plugin{
credentialpassword.New(),
},
})
The resulting handler is mounted on the application’s HTTP router:
mux := http.NewServeMux()
mux.Handle("/api/auth/", auth.Handler())
The example uses GORM with PostgreSQL, but engineers can replace the database layer with their own setup. Instead of putting the secret in configuration, the README also documents setting the LIMEN_SECRET environment variable. For configuration beyond the quick start—including OAuth, two-factor authentication, other adapters, and framework integration—the README directs users to the full documentation and repository examples.