MCPcopy Index your code
hub / github.com/authorizerdev/authorizer

github.com/authorizerdev/authorizer @2.3.0 sqlite

repository ↗ · DeepWiki ↗ · release 2.3.0 ↗
7,194 symbols 19,293 edges 615 files 2,291 documented · 32%
README

Authorizer

Authorizer

Open-source authentication and authorization for your applications.

Bring your own database and stay in control of user data.

Documentation · OAuth 2.0 / OIDC · v1 → v2 migration · Contributing · Discord

CI Docker Repository on Quay Go Report Card CII Best Practices govulncheck OpenSSF Scorecard

Authorizer is an open-source authentication and authorization server you can self-host. Connect any supported database (13+ backends including Postgres, MySQL, SQLite, SQL Server, YugaByte, MariaDB, Cassandra, ScyllaDB, MongoDB, ArangoDB, DynamoDB, and Couchbase) and run OAuth2/OIDC, social login, MFA, magic links, RBAC, webhooks, and email templates from one place.

v2 note: Authorizer v2 uses CLI arguments for all configuration. The server does not read from .env or OS environment variables. Pass config when starting the binary (e.g. ./authorizer --client-id=... --client-secret=...). See MIGRATION.md.

Quick start (local)

Prerequisites: Go ≥ 1.24 (see go.mod).

git clone https://github.com/authorizerdev/authorizer.git
cd authorizer
make dev

make dev runs the server with SQLite and development defaults (RS256 keys, sample client credentials). Open the URL printed in the logs (default port 8080) and sign in with --admin-secret (admin in dev).

For production builds, tests, and Docker, see Getting Started below.

Introduction

We offer the following functionality

  • ✅ Sign-in / Sign-up with email ID and password
  • ✅ Secure session management
  • ✅ Email verification
  • ✅ OAuth2 and OpenID compatible APIs
  • ✅ APIs to update profile securely
  • ✅ Forgot password flow using email
  • ✅ Social logins (Google, Github, Facebook, LinkedIn, Apple more coming soon)
  • ✅ Role-based access management
  • ✅ Password-less login with magic link login
  • ✅ Multi factor authentication
  • ✅ Email templating
  • ✅ Webhooks

Roadmap

  • VueJS SDK
  • Svelte SDK
  • Golang SDK
  • React Native SDK
  • Flutter SDK
  • Android Native SDK
  • iOS native SDK
  • Python SDK
  • PHP SDK
  • WordPress plugin
  • Kubernetes Helm Chart
  • Local Stack
  • AMI
  • Digital Ocean Droplet
  • Azure
  • Render
  • Edge Deployment using Fly.io
  • Password-less login with mobile number and OTP SMS

Getting Started

Step 1: Get Authorizer Instance

Deploy Production Ready Instance

Deploy production ready Authorizer instance using one click deployment options available below

Infra provider One-click link Additional information
Railway.app Deploy on Railway docs
Heroku Deploy to Heroku docs
Render Deploy to Render docs
Koyeb Deploy to Koyeb docs
RepoCloud Deploy on RepoCloud docs
Alibaba Cloud Alibaba Cloud docs

Deploy Authorizer Using Source Code

This guide helps you practice using Authorizer to evaluate it before you use it in a production environment. It includes instructions for installing the Authorizer server in local or standalone mode.

Prerequisites

  • OS: Linux or macOS or Windows
  • Go >= 1.24 (see go.mod)
  • Node.js >= 18 and npm (only if building the web app and dashboard)

Project Setup

  1. Fork the authorizer repository (skip if you already have access)
  2. Clone: git clone https://github.com/authorizerdev/authorizer.git (or your fork URL)
  3. cd authorizer
  4. Fastest path: make dev — SQLite, RS256 dev keys, sample OAuth client (see Quick start)
  5. Full build: make build (or go build -o build/authorizer .); optionally make build-app and make build-dashboard
  6. Custom flags instead of make dev: bash ./build/authorizer \ --database-type=sqlite \ --database-url=test.db \ --jwt-type=HS256 \ --jwt-secret=test \ --admin-secret=admin \ --client-id=123456 \ --client-secret=secret

    v2: The server does not read from .env. All configuration must be passed as CLI arguments. See MIGRATION.md for the full mapping of env vars to flags.

Run with Docker

The default image runs as non-root (UID 65532). Writable mounts (SQLite under /authorizer/data, etc.) are usually root-owned, so pick one of:

  1. Run as root for that container (simplest for local SQLite + volumes):

sh docker run -p 8080:8080 -u root \ -v authorizer_data:/authorizer/data \ quay.io/authorizer/authorizer \ --database-type=sqlite \ --database-url=/authorizer/data/data.db \ --client-id=123456 \ --client-secret=secret \ --admin-secret=admin \ --jwt-type=HS256 \ --jwt-secret=test

  1. Keep non-root and make the mount writable by 65532 (good for production-style bind mounts):

sh mkdir -p ./data && sudo chown -R 65532:65532 ./data docker run -p 8080:8080 \ -v "$(pwd)/data:/authorizer/data" \ quay.io/authorizer/authorizer \ --database-type=sqlite \ --database-url=/authorizer/data/data.db \ ...

  1. Build from source with the root target (no -u at run time):

sh docker build --target final-root -t authorizer:root . docker run -p 8080:8080 -v authorizer_data:/authorizer/data authorizer:root \ --database-type=sqlite --database-url=/authorizer/data/data.db ...

  • Port 8080 serves the app and GraphQL; use -p 8080:8080 to expose it.
  • Volume authorizer_data persists the SQLite DB; use a named volume or a host path (e.g. -v $(pwd)/data:/authorizer/data).
  • All config is passed as CLI arguments (the image uses ENTRYPOINT ["./authorizer"] so args after the image name go to the binary). See MIGRATION.md for the full list of flags.

Database on your laptop (Postgres, MySQL, etc.)

Inside a container, localhost / 127.0.0.1 is the container itself, not your machine. Use a host alias instead:

  • Docker Desktop (macOS / Windows): use host.docker.internal in --database-url or --database-host (built in).

sh docker run -p 8080:8080 quay.io/authorizer/authorizer \ --database-type=postgres \ --database-url="postgres://user:pass@host.docker.internal:5432/dbname?sslmode=disable" \ ...

  • Linux (Docker Engine): add the same hostname so it resolves to the host:

sh docker run -p 8080:8080 --add-host=host.docker.internal:host-gateway \ quay.io/authorizer/authorizer \ --database-type=postgres \ --database-url="postgres://user:pass@host.docker.internal:5432/dbname?sslmode=disable" \ ...

  • Alternative on Linux: use the docker bridge gateway IP (often 172.17.0.1) if your DB listens on 0.0.0.0, or run with --network host so the container shares the host network (then localhost works; port mapping -p is not used the same way).

Ensure the database accepts non-localhost connections (e.g. listen_addresses in Postgres, bind address in MySQL) and that your OS firewall allows the Docker subnet.

Extending the image with env-based config (e.g. Railway): If you FROM quay.io/authorizer/authorizer and use a shell-form CMD so that env vars are expanded at runtime, you must override ENTRYPOINT in your Dockerfile or the binary will receive /bin/sh and -c as arguments and fail. Use:

FROM quay.io/authorizer/authorizer:2.0.0-rc.1
# v2 uses CLI arguments only. Railway (etc.) inject env vars; shell form CMD expands them at runtime.
# Override ENTRYPOINT so CMD is run by a shell; otherwise the base ENTRYPOINT would receive /bin/sh -c "..." as args.
ENTRYPOINT ["/bin/sh", "-c"]
CMD ./authorizer \
  --database-type="$${DATABASE_TYPE:-postgres}" \
  --database-url="$${DATABASE_URL}" \
  --client-id="$${CLIENT_ID}" \
  --client-secret="$${CLIENT_SECRET}" \
  --admin-secret="$${ADMIN_SECRET}" \
  ...

Use $$ in the Dockerfile so Docker does not expand $VAR at build time.

Deploy Authorizer using binaries

Deploy / Try Authorizer using binaries. With each Authorizer Release, binaries are baked with required deployment files and bundled. You can download a specific version for the following operating systems:

  • macOS (amd64, arm64)
  • Linux (amd64, arm64)

Download and unzip bundle

  • Download the bundle for your OS/arch from the release page

Note: For Windows, we recommend running Authorizer via Docker.

  • Unzip (Mac / Linux): sh tar -zxf authorizer-VERSION-OS-ARCH.tar.gz cd authorizer-VERSION-OS-ARCH

Start Authorizer

  • Run the binary with required CLI arguments: sh ./authorizer \ --database-type=sqlite \ --database-url=test.db \ --jwt-type=HS256 \ --jwt-secret=test \ --admin-secret=admin \ --client-id=123456 \ --client-secret=secret

v2: The binary is named authorizer (not server). Configuration is passed via CLI arguments; .env is not read. On macOS you may need: xattr -d com.apple.quarantine authorizer

Step 2: Setup Instance

  • Open the Authorizer instance endpoint in your browser
  • Sign in as admin using the --admin-secret you configured at startup

v2: Environment variables are not configurable from the dashboard. All configuration is set at startup via CLI arguments. See MIGRATION.md for the full list of flags.

Things to consider

  • For social logins, you will need respective social platform key and secret
  • For having verified users, you will need an SMTP server with an email address and password using which system can send emails. The system will send a verification link to an email address. Once an email is verified then, only able to access it.

    Note: One can alway

Extension points exported contracts — how you extend this code

AdminProvider (Interface)
AdminProvider is the transport-agnostic API for Authorizer's super-admin operations (the `_`-prefixed GraphQL queries/mu [2 …
internal/service/admin_provider.go
AuthorizationEngine (Interface)
AuthorizationEngine is the SPI for a ReBAC authorization backend. All decision methods (Check, BatchCheck, ListObjects) [1 …
internal/authorization/engine/engine.go
Provider (Interface)
Provider interface for email provider
internal/email/email.go
Provider (Interface)
Provider is the interface for audit logging.
internal/audit/provider.go
Provider (Interface)
Provider defines current memory store provider
internal/memory_store/provider.go
Provider (Interface)
Provider is the interface that provides the methods to interact with the oauth providers.
internal/oauth/provider.go
Provider (Interface)
Provider is the interface which defines the methods for the database provider
internal/storage/provider.go
Provider (Interface)
Provider interface for token provider
internal/token/provider.go

Core symbols most depended-on inside this repo

Error
called by 1186
internal/service/errors.go
Run
called by 587
internal/server/server.go
Set
called by 276
internal/memory_store/redis/provider.go
StringValue
called by 221
internal/refs/string.go
NewStringRef
called by 175
internal/refs/string.go
Close
called by 159
internal/rate_limit/provider.go
getTestConfig
called by 139
internal/integration_tests/test_helper.go
initTestSetup
called by 139
internal/integration_tests/test_helper.go

Shape

Method 5,308
Function 1,090
Struct 631
Interface 141
Enum 11
Class 6
TypeAlias 6
FuncType 1

Languages

Go95%
TypeScript3%
Python2%

Modules by API surface

internal/graph/generated/generated.go1,066 symbols
gen/go-client/buf/validate/validate.pb.go769 symbols
gen/go/authorizer/v1/admin.pb.go603 symbols
gen/go-client/authorizer/v1/admin.pb.go603 symbols
gen/go/authorizer/v1/authorizer.pb.go301 symbols
gen/go-client/authorizer/v1/authorizer.pb.go301 symbols
gen/go/authorizer/v1/admin_grpc.pb.go169 symbols
gen/go-client/authorizer/v1/admin_grpc.pb.go169 symbols
gen/go/authorizer/v1/types.pb.go117 symbols
gen/go-client/authorizer/v1/types.pb.go117 symbols
gen/go/authorizer/v1/authorizer_grpc.pb.go109 symbols
gen/go-client/authorizer/v1/authorizer_grpc.pb.go109 symbols

Dependencies from manifests, versioned

buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/gov1.36.11-20260415201 · 1×
buf.build/go/protovalidatev1.2.0 · 1×
cel.dev/exprv0.25.1 · 1×
filippo.io/edwards25519v1.2.0 · 1×
github.com/IBM/pgxpoolprometheusv1.1.3 · 1×
github.com/Yiling-J/theine-gov0.6.2 · 1×
github.com/agnivade/levenshteinv1.2.1 · 1×
github.com/antlr4-go/antlr/v4v4.13.1 · 1×
github.com/arangodb/go-driverv1.6.0 · 1×

Datastores touched

(mongodb)Database · 1 repos
dbDatabase · 1 repos
postgresDatabase · 1 repos
dbDatabase · 1 repos
dbnameDatabase · 1 repos
fgaDatabase · 1 repos

For agents

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

⬇ download graph artifact