MCPcopy Index your code
hub / github.com/Authula/authula

github.com/Authula/authula @v1.15.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.15.0 ↗ · + Follow
4,087 symbols 13,413 edges 535 files 460 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Project Banner Image

GitHub stars Go Reference License

Become a Sponsor!


Overview

Authula is an open-source authentication solution that scales with you. Embed it as a library in your Go app, or run it as a standalone auth server with any tech stack. It simplifies adding robust authentication to backend services, empowering developers to build secure applications faster.

All functionality is delivered through a powerful plugin system, allowing you to compose exactly the authentication stack you need — no more, no less, all built with clean architecture. Authula is flexible enough to integrate with any technology stack. It streamlines the implementation of essential security features through a clean, modular architecture, allowing developers to concentrate on building their applications without the overhead of managing authentication complexities.


Plugins & Capabilities

Authula is architected around a powerful plugin and capability system.

Plugins are modular packages that encapsulate related authentication features.
Capabilities represent individual, fine-grained functionalities exposed by these plugins.

Each plugin can offer multiple capabilities, and every route in your application explicitly declares which capabilities it leverages. This approach ensures that authentication logic is:

  • Explicit – No hidden behaviors; every capability is clearly declared.
  • Composable – Mix and match only the features you need.
  • Auditable – Easily track which routes use which authentication features.
  • Understandable – The authentication flow is transparent and easy to reason about.

This design empowers you to build secure, maintainable, and highly customizable authentication flows tailored to your application's needs.


Features

Authula comes with a variety of plugins that provide essential authentication features out of the box:

  • Email & Password: Email-based flows for registration, login, email verification, password reset & email change.
  • OAuth providers
  • TOTP: Authenticator app support, backup codes, trusted devices for two-factor authentication
  • Multiple database backends (SQLite, PostgreSQL, MySQL)
  • Secondary storage (In-memory, DB, Redis)
  • Rate limiting
  • CSRF protection
  • Hooks system
  • Event bus
  • Custom routes and logic

Hooks System

Authula includes a powerful, lifecycle-based hooks system that lets you intercept and customize request handling at every stage of the HTTP request/response cycle.

Hooks allow you to implement:

  • custom authentication logic
  • request validation
  • logging & tracing
  • metrics
  • access control
  • A/B testing
  • feature flags
  • audit trails
  • custom headers
  • dynamic routing

All without modifying core code.

Build your own plugins for:

  • business logic
  • custom routes
  • custom auth flows
  • external integrations
  • internal tooling

Design Principles

  • Plugin-first architecture
  • Clean architecture
  • Minimal dependencies
  • Standard library first
  • Secure by default
  • Framework agnostic
  • Self-hosted
  • Extensible

Quick Start

Get Started with Authula


Docs

For more info and a full guide on how to use this library, check out the Docs.


SDKs

We provide the following SDKs to facilitate easy integration with Authula:


Contributing

Your contributions are welcome! Here's how you can get involved:


Support & Community

Join our growing community for support, discussions, and updates:

If you'd like to support the ongoing development of this project, consider subscribing on Polar!

Subscribe on Polar


GitHub Stars

Star History Chart


Our Sponsors

🏢 Corporate Sponsors

🥇 Gold Sponsors

🥈 Silver Sponsors

🥉 Bronze Sponsors


Extension points exported contracts — how you extend this code

Logger (Interface)
Logger is a minimal logging interface used by the migrator. [7 implementers]
migrations/migrator.go
SecondaryStorage (Interface)
SecondaryStorage defines an interface for secondary storage operations. [6 implementers]
models/storage.go
Plugin (Interface)
Plugin is the base interface all plugins must implement [15 implementers]
models/plugin.go
Logger (Interface)
Logger defines an interface for logging operations, allowing users to plug in different logging implementations such as [7 …
models/logger.go
UserRepository (Interface)
Repository interfaces for data access - these will be implemented by plugins [4 implementers]
internal/repositories/interfaces.go
MailerService (Interface)
(no doc) [6 implementers]
services/email.go
RateLimiterService (Interface)
(no doc) [6 implementers]
services/core.go
RateLimitProvider (Interface)
RateLimitProvider defines the interface for rate limit storage backends Implementations can use in-memory storage, Redis [4 …
plugins/rate-limit/types/api.go

Core symbols most depended-on inside this repo

Error
called by 870
models/logger.go
Get
called by 479
models/storage.go
SetJSONResponse
called by 303
models/context.go
Set
called by 200
models/storage.go
String
called by 119
plugins/jwt/hooks.go
GetRequestContext
called by 117
models/context.go
Scan
called by 103
models/storage.go
RequireAuthenticated
called by 78
middleware/actors.go

Shape

Method 2,065
Function 1,207
Struct 684
Interface 98
TypeAlias 26
FuncType 7

Languages

Go100%

Modules by API surface

plugins/organizations/repositories/interfaces.go73 symbols
plugins/jwt/tests/mocks.go70 symbols
internal/tests/mock_services.go55 symbols
services/core.go52 symbols
plugins/admin/handlers/state_handlers.go51 symbols
plugins/organizations/tests/repositories.go48 symbols
plugins/admin/types/api.go46 symbols
internal/tests/mock_repositories.go45 symbols
internal/repositories/interfaces.go45 symbols
plugins/admin/usecases/admin_usecases.go38 symbols
plugins/admin/tests/test_helpers.go37 symbols
plugins/admin/api.go37 symbols

For agents

$ claude mcp add authula \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact