Plain Auth
Open-source authentication library for Go HTTP servers with sessions, passkeys, OAuth/OIDC, organizations and SQLite, PostgreSQL or MySQL storage.
At a Glance
MIT-licensed Go authentication library, self-hosted; developer preview.
Engagement
Available On
Alternatives
Listed Dec 2026
About Plain Auth
Plain Auth is an MIT-licensed authentication library for Go servers, maintained under the Plain-Org GitHub organization. It mounts as an http.Handler on an existing router and exposes a JSON API that any frontend or HTTP client can call. It is a developer preview: the README states that APIs and SQL migrations may change before the first tagged release.
What It Is
Plain Auth adds sign-in, sessions and account management to a Go application without taking over the host app. The application keeps its own listener, middleware, routes, database and screens. Inside its own handlers it calls auth.GetSession on the same instance to read the signed-in user, which is nil for anonymous requests. The package name is plainauth, and it reads AUTH_SECRET and AUTH_URL from the environment.
Capabilities
Documented sign-in methods include email and password, usernames, magic links, email or SMS codes, passkeys, social providers, Google One Tap, Ethereum wallets and guest accounts. Sessions are database-backed and revocable, with optional cookie caching, multiple accounts per browser, device authorization and cross-subdomain cookies. Security features include two-factor authentication, rate limits shared through Redis or Valkey, CAPTCHA, breached-password checks and trusted origins.
Beyond basic login, it covers organizations and teams with roles, permissions and invitations, administrator accounts and API keys. Enterprise features include OIDC and SAML single sign-on and SCIM provisioning. It can also act as an OAuth 2.0 and OpenID Connect provider with PKCE, refresh tokens, client registration, introspection, revocation and JWKS. Billing integrations cover Stripe and Polar.
Setup Path
The quickstart clones the repository, generates a secret with authctl, and runs an example app that creates a local SQLite database. To add it to an app, install the SQLite adapter with go get, create a store, call plainauth.New with options, and mount the handler under its base path (/api/auth by default). The README requires a recent Go 1.26 toolchain and a C compiler for SQLite. Router guides cover ServeMux, chi, Gorilla Mux, Gin, Echo and Fiber, and PostgreSQL and MySQL are supported alongside SQLite. Extension is possible through Go plugins and endpoint hooks, and an OpenAPI document, Go client and test helpers are included.
Current Status
The project is a developer preview. The README notes that a hosted Plain Auth service is coming soon for teams that would rather not run it themselves.
Collections
Popular collections
- Obsidian Agentic & AI plugins
Collection by @samofcode
- Codebase Context Generators
Collection by @joemseifi
- Frameworks
Collection by @joemseifi
- Run YOLO Mode Without Risking Your Laptop
Collection by @reproalex
Add Plain Auth to one of your collections.
Community Discussions
Be the first to start a conversation about Plain Auth
Share your experience with Plain Auth, ask questions, or help others learn from your insights.
Pricing
Open Source (Self-hosted)
MIT-licensed Go authentication library, self-hosted; developer preview.
- MIT License
- Sessions, passkeys, OAuth/OIDC provider, organizations
- SQLite, PostgreSQL and MySQL storage
- Developer preview: APIs and SQL migrations may change before first tagged release
Capabilities
Key Features
- Email/password, username, magic link, email/SMS code sign-in
- Passkeys and social providers
- Google One Tap, Ethereum wallet and guest accounts
- Database-backed revocable sessions
- Two-factor authentication, CAPTCHA and breached-password checks
- Organizations, teams, roles, permissions and invitations
- OIDC and SAML single sign-on and SCIM provisioning
- OAuth 2.0 and OpenID Connect provider
- API keys and administrator accounts
- SQLite, PostgreSQL and MySQL storage
- authctl schema CLI
- OpenAPI document and Go client
- Error messages in 22 languages
- Go plugins and endpoint hooks
