> For the complete documentation index, see [llms.txt](https://azutopia.gitbook.io/authority/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://azutopia.gitbook.io/authority/readme.md).

# Introduction

**Production-ready OAuth 2.0 Server and OpenID Connect 1.0 Provider**

Authority is a complete authentication infrastructure built with Crystal, featuring enterprise-grade security and a modern admin dashboard.

## Quick Start

Get Authority running in 5 minutes:

```bash
# Clone the repository
git clone https://github.com/azutoolkit/authority.git
cd authority

# Start with Docker
docker-compose up -d

# Visit http://localhost:4000
```

See [Quick Start Tutorial](/authority/tutorials/quick-start.md) for a complete walkthrough.

## Key Features

| Category           | Features                                                                  |
| ------------------ | ------------------------------------------------------------------------- |
| **OAuth 2.0**      | Authorization Code, PKCE, Client Credentials, Device Flow, Refresh Tokens |
| **OpenID Connect** | ID Tokens, UserInfo, Discovery, JWKS                                      |
| **Security**       | MFA/TOTP, Account Lockout, Password Policies, Audit Logging               |
| **Admin**          | Client Management, User Management, Scope Configuration, Settings         |

## Documentation Overview

This documentation is organized using the [Diataxis framework](https://diataxis.fr/):

### [Tutorials](/authority/tutorials/tutorials.md)

Step-by-step guides for learning Authority:

* [Quick Start](/authority/tutorials/quick-start.md) - Get running in 5 minutes
* [First OAuth Integration](/authority/tutorials/first-oauth-integration.md) - Build your first OAuth app
* [Protect Your API](/authority/tutorials/protect-your-api.md) - Secure your endpoints
* [Add User Authentication](/authority/tutorials/add-user-authentication.md) - Implement login flows

### [How-To Guides](/authority/how-to-guides/docker.md)

Task-oriented guides for specific goals:

* [Installation](/authority/how-to-guides/docker.md) - Docker, source, Kubernetes
* [Configuration](/authority/how-to-guides/environment-variables.md) - Environment setup
* [Security](/authority/how-to-guides/enable-mfa.md) - MFA, lockout, passwords
* [OAuth Clients](/authority/how-to-guides/register-client.md) - Client management

### [Reference](/authority/reference/oauth2.md)

Technical specifications and API documentation:

* [OAuth 2.0 Flows](/authority/reference/oauth2.md) - Grant type specifications
* [OpenID Connect](/authority/reference/openid-connect.md) - OIDC endpoints
* [API Endpoints](/authority/reference/endpoints.md) - Complete API reference
* [Configuration](/authority/reference/all-options.md) - All settings

### [Explanation](/authority/explanation/architecture.md)

Understanding concepts and architecture:

* [Architecture](/authority/explanation/architecture.md) - System design
* [OAuth 2.0 Concepts](/authority/explanation/oauth2-concepts.md) - Protocol fundamentals
* [Security Model](/authority/explanation/security-model.md) - Security architecture
* [Choosing Grant Types](/authority/explanation/grant-type-selection.md) - Decision guide

## Standards Compliance

Authority implements these specifications:

* [RFC 6749](https://tools.ietf.org/html/rfc6749) - OAuth 2.0 Authorization Framework
* [RFC 6750](https://tools.ietf.org/html/rfc6750) - Bearer Token Usage
* [RFC 7519](https://tools.ietf.org/html/rfc7519) - JSON Web Token (JWT)
* [RFC 7636](https://tools.ietf.org/html/rfc7636) - Proof Key for Code Exchange (PKCE)
* [RFC 7662](https://tools.ietf.org/html/rfc7662) - Token Introspection
* [RFC 7009](https://tools.ietf.org/html/rfc7009) - Token Revocation
* [RFC 8628](https://tools.ietf.org/html/rfc8628) - Device Authorization Grant
* [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html)

## Technology Stack

| Component     | Technology                 |
| ------------- | -------------------------- |
| Language      | Crystal                    |
| Web Framework | Azu                        |
| Database      | PostgreSQL                 |
| Templating    | Crinja (Jinja2-compatible) |
| Caching       | Redis (optional)           |

## Screenshots

![Landing Page](/files/3g30C1eGjf5A9tbaTg3d)

![Admin Dashboard](/files/AaTPjggftL8NI9OoAs7k)
