Skip to content
dnahilman edited this page Jun 16, 2026 · 4 revisions

Goten Wiki

GotenGo Language Otentikasi — is a composable, modular authentication library for Go with a multi-module plugin architecture. Install only what you need, no unused code in your binary.

Inspired by better-auth, Limen, and Go-better-auth.

Status: v0.2.0 — early release, API may change before v1.0.


Getting started

  • Quick Start — install Goten, spin up Postgres, run migrations, and exercise the full sign-up / sign-in / protected-route flow end-to-end with curl.

Framework integrations

  • Goten with Gin — mount Goten under the Gin HTTP framework using gin.WrapH, with a small Gin-idiomatic middleware adapter for protected routes.
  • React + TypeScript client — a typed fetch client + useSession hook for the cookie-based session, including cross-origin dev notes.

Reference

The README in the main repository is the source of truth for reference documentation:

  • Endpoints table — every HTTP route shipped by core (plus the OAuth plugin routes).
  • CLIgoten generate emits ORM models from core + active plugins; you apply them with db.AutoMigrate.
  • Plugins — Username plugin, OAuth (Sign in with Google), and how to build your own.
  • Architecture — the multi-module layout.
  • ID & Token Formatg10_ prefix conventions.
  • CSRF Protection — origin-check rules and how to harden for production.

Examples

  • examples/basic/ — runnable HTTP server with Postgres via Docker Compose, demonstrating both the core email flow and the username plugin. This is what the Quick Start guide drives.
  • examples/layered-gin/ — Gin + GORM with a layered handler → service → repository architecture.
  • examples/oauth-google/ — Sign in with Google via the OAuth plugin (PKCE + OIDC), including Google Cloud Console setup.

Contributing & Security

Clone this wiki locally