Configuration (quick index)
This page is a short index. For exhaustive coverage use the dedicated configuration and callback docs.
Essential fields
| Field | Required | Doc |
|---|---|---|
Secret | Yes | Config reference |
Providers | Yes | Providers overview |
Adapter | For DB sessions, email, OTP, MFA storage, passkeys | Adapters |
URL / TrustHost | Production | Config reference |
Pick a full example config
| Your app | Scenario doc |
|---|---|
| GitHub only, no DB | Scenario 1 — OAuth only |
| SaaS with Postgres | Scenario 2 — OAuth + DB |
| Password login | Scenario 3 — Credentials |
| Password + SMS/email code after login | Scenario 4 — MFA |
| Magic link | Scenario 5 — Email |
| “Enter 6-digit code to sign in” | Scenario 6 — OTP provider |
| React Native / API | Scenario 7 — Tokens |
| Passkeys | Scenario 8 |
| Everything | Scenario 9 — Enterprise |
Callbacks & OTP
| Topic | Doc |
|---|---|
| All callbacks | Callbacks overview |
| Create users in your DB | ResolveUser |
| Send & verify codes | OTP & verification |
| Production walkthrough | Developer cookbook |
Production checklist
goauth.Config{
Secret: []string{os.Getenv("AUTH_SECRET")},
URL: "https://app.example.com",
TrustHost: false,
Adapter: adapter,
// ... providers, callbacks — see cookbook
}