Skip to content

Authula/authula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

118 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Authula Logo


Introduction

✨ 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.


🎯 Who is it for?

Authula is ideal for:

  • Startups that want full control over their authentication stack
  • Teams building microservices or multi-backend systems
  • Companies with self-hosting or compliance requirements
  • Go developers who want first-class embedded auth
  • Anyone who wants modern auth without SaaS lock-in

🧩 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: Authentication, Email Verification & Password Reset
  • 🌐 OAuth providers
  • πŸ” TOTP: Authenticator app support, backup codes, trusted devices for two-factor authentication
  • πŸ’Ύ Multiple database backends
  • πŸ—„οΈ Secondary storage (Redis, memory, DB)
  • ⚑ 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 pipeline.

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

Deployment Modes

Embedded Mode (Go Library)

Embed Authula directly into your Go application:

import (
  authula "github.com/Authula/authula"
  authulaconfig "github.com/Authula/authula/config"
  authulamodels "github.com/Authula/authula/models"
  authulaenv "github.com/Authula/authula/env"
)

config := authulaconfig.NewConfig(
  authulaconfig.WithAppName("AuthulaPlayground"),
  authulaconfig.WithBasePath("/api/auth"),
  authulaconfig.WithDatabase(authulamodels.DatabaseConfig{
    Provider: "postgres",
    URL:      os.Getenv(authulaenv.EnvDatabaseURL),
  }),
  // other config options...
)

auth := authula.New(authula.AuthConfig{
  Config:  config,
  Plugins: []authulamodels.Plugin{
    emailpasswordplugin.New(...),
    // other plugins...
  },
})

http.ListenAndServe(":8080", auth.Handler())

You get:

  • zero network overhead
  • full type safety
  • native integration
  • maximum performance

Standalone Mode

Run Authula as a standalone authentication server via Docker:

docker run -itd -p 8080:8080 \
  -v $(pwd)/config.toml:/home/appuser/config.toml \
  -e AUTHULA_BASE_URL=http://localhost:8080 \
  -e AUTHULA_SECRET=my-app-secret \
  -e AUTHULA_DATABASE_URL=<your_connection_string> \
  # other env vars depending on plugins used...
  ghcr.io/authula/authula:latest

Use it from any language or framework over HTTP.


🧠 Design Principles

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

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:

Star History Chart


Support & Community

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


πŸ’Ž Support Development

If you'd like to support the ongoing development of this project, consider subscribing on Polar, it means a lot to me!

Subscribe on Polar


πŸ’– Our Sponsors

🏒 Corporate Sponsors

πŸ₯‡ Gold Sponsors

πŸ₯ˆ Silver Sponsors

πŸ₯‰ Bronze Sponsors


About

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.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Languages