Skip to content
프로젝트

소개

Go를 위한 현대적이고 조합 가능한 인증

보안 및 개인정보 보호

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+4
in 7 days
+15
in 15 days
+25
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Limen — Composable authentication for Go

A modern, composable authentication library for Go, inspired by better-auth.

Documentation · Issues · X (@limenauth)

Go reference npm version GitHub stars

Limen is a modular authentication library for Go that takes a plugin-first approach — the core ships with interfaces, session management, and security primitives, while every authentication method lives in its own importable Go module. You compose exactly the auth stack your application needs without pulling in code/dependencies you don't use.

Out of the box, Limen provides:

  • Credential/password authentication
  • OAuth 2.0
  • Two-factor authentication
  • Session management
  • ...and more

Bring your own database, bring your own framework — Limen adapts to your stack, not the other way around.

Documentation

Full guides, configuration reference, and plugin documentation are available at limenauth.dev.

Requirements

  • Go 1.25+

Installation

go get github.com/thecodearcher/limen

Then add the adapter and plugins your application needs:

go get github.com/thecodearcher/limen/adapters/gorm
go get github.com/thecodearcher/limen/plugins/credential-password

Quick Start

package main

import (
	"log"
	"net/http"

	"gorm.io/driver/postgres"
	"gorm.io/gorm"

	"github.com/thecodearcher/limen"
	gormadapter "github.com/thecodearcher/limen/adapters/gorm"
	credentialpassword "github.com/thecodearcher/limen/plugins/credential-password"
)

func main() {
	db, err := gorm.Open(postgres.Open("your-dsn"), &gorm.Config{})
	if err != nil {
		log.Fatal(err)
	}

	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(),
		},
	})
	if err != nil {
		log.Fatal(err)
	}

	mux := http.NewServeMux()
	mux.Handle("/api/auth/", auth.Handler())

	log.Println("listening on :8080")
	log.Fatal(http.ListenAndServe(":8080", mux))
}

Alternatively, set the LIMEN_SECRET environment variable and omit the Secret from the struct.

For a more complete example with OAuth providers, two-factor auth, and Gin integration, see the examples.

For full configuration options, usage, and plugin APIs, visit limenauth.dev.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Curious what's being built, what's open for contribution, and what's out of scope? See ROADMAP.md. If you're planning to contribute, check there and open an issue first.

Security

Found a security issue? Please do not open a public issue. Email [email protected] instead. See SECURITY.md for full details on our disclosure process.

License

MIT License — see LICENSE for details.

관련 프로젝트 살펴보기

불러오는 중…