Expand description
§TurboMCP Auth - OAuth 2.1 and Authentication
OAuth 2.1, API key authentication, and authorization functionality for the TurboMCP protocol with MCP specification compliance.
§Features
- OAuth 2.1 - RFC 8707/9728/7591 compliant with MCP resource binding
- Multi-Provider - Google, GitHub, Microsoft, GitLab with PKCE
- API Key Auth - Simple API key authentication provider
- Session Management - Token storage and lifecycle management
- DPoP Support - Optional RFC 9449 proof-of-possession tokens (feature:
dpop)
§Architecture
config- Configuration types for authentication providerstypes- Core authentication types (AuthContext, UserInfo, TokenInfo)providers- Authentication provider implementationsapi_key- API key authentication
manager- Authentication manager for provider orchestrationoauth2- OAuth 2.1 client with authorization flows
§Feature Flags
default- Core authentication (no optional features)dpop- Enable DPoP (RFC 9449) token binding support viaturbomcp-dpop
Re-exports§
pub use api_key::ApiKeyProvider;pub use turbomcp_dpop as dpop;
Modules§
- api_key
- API Key Authentication Provider
- config
- Authentication Configuration Types
- manager
- Authentication Manager
- oauth2
- OAuth 2.1 Implementation
- providers
- Authentication Providers
- types
- Core Authentication Types
Structs§
- Access
Token - Secure access token with metadata
- Auth
Config - Authentication configuration
- Auth
Context - Authentication context containing user information and session data
- Auth
Manager - Authentication manager for coordinating multiple authentication providers
- Auth
Provider Config - Authentication provider configuration
- Authorization
Config - Authorization configuration
- Client
Registration Error - Client Registration Error Response (RFC 7591)
- Client
Registration Request - Dynamic Client Registration Request (RFC 7591)
- Client
Registration Response - Dynamic Client Registration Response (RFC 7591)
- Default
Auth Middleware - Default authentication middleware
- Device
Authorization Response - Device authorization response for CLI/IoT flows
- Dpop
Config - DPoP (Demonstration of Proof-of-Possession) configuration
- Dynamic
Client Registration - Dynamic Client Registration Manager for RFC 7591 compliance
- McpResource
Registry - MCP Server Resource Registry for RFC 9728 compliance
- OAuth2
Auth Result - OAuth 2.1 authorization result
- OAuth2
Config - OAuth 2.1 configuration
- Protected
Resource Metadata - Protected Resource Metadata (RFC 9728) for server-side discovery
- Provider
Config - Provider-specific configuration for handling OAuth quirks
- Session
Config - Session configuration
- Token
Info - Token information
- User
Info - User information
Enums§
- Application
Type - Application type for OAuth client (RFC 7591)
- Auth
Credentials - Authentication credentials
- Auth
Provider Type - Authentication provider types
- Bearer
Token Method - Bearer token delivery methods (RFC 9728)
- Client
Registration Error Code - Client Registration Error Codes (RFC 7591)
- Dpop
KeyStorage Config - DPoP key storage configuration
- OAuth2
Flow Type - OAuth 2.1 flow types
- Provider
Type - OAuth2 provider types with built-in configurations
- Refresh
Behavior - Token refresh behavior strategies
- Security
Level - Security levels for OAuth 2.1 flows
- Session
Storage Type - Session storage types
Traits§
- Auth
Middleware - Authentication middleware trait
- Auth
Provider - Authentication provider trait
- Token
Storage - Secure token storage abstraction