atproto-oauth-axum
Axum web handlers for AT Protocol OAuth 2.0 authorization server endpoints.
Overview
atproto-oauth-axum
provides ready-to-use Axum web handlers that implement the complete AT Protocol OAuth 2.0 authorization server specification. This library handles OAuth client metadata discovery, JWKS endpoints, authorization callback processing, and includes a command-line OAuth login tool.
Binaries
- atproto-oauth-tool: Complete OAuth login CLI tool for AT Protocol services
Features
- Complete OAuth server handlers for Axum web applications
- Client metadata endpoint with RFC 7591 compliance
- JWKS endpoint for JSON Web Key Set serving
- Authorization callback handler with token exchange
- Native Axum state management and request extractors
- AT Protocol compliance validation
Usage
Basic Server Setup
use ;
use ;
let oauth_config = OAuthClientConfig ;
let app = new
.route
.route
.route
.with_state;
OAuth Handlers
The library provides ready-to-use handlers for:
- Client Metadata: Generates RFC 7591 compliant metadata
- JWKS Endpoint: Serves JSON Web Key Sets for signature verification
- Callback Processing: Handles OAuth authorization callbacks with token exchange
Command Line Examples
# Start OAuth login flow for a handle
# Start OAuth login flow for a DID
The tool provides a complete OAuth client implementation with:
- Subject resolution and DID document retrieval
- PDS and authorization server discovery
- PKCE and DPoP parameter generation
- Local web server for callback handling
- Complete token exchange flow
License
MIT License