| Crates.io | oauth-provider-rs |
| lib.rs | oauth-provider-rs |
| version | 0.1.0-alpha.7 |
| created_at | 2025-07-09 17:19:25.936789+00 |
| updated_at | 2025-07-12 01:17:30.644841+00 |
| description | A Rust implementation of an OAuth 2.0 provider with DynamoDB storage support |
| homepage | https://github.com/akihito/oauth-mcp-server |
| repository | https://github.com/akihito/oauth-mcp-server |
| max_upload_size | |
| id | 1745196 |
| size | 571,454 |
A production-ready Rust implementation of an OAuth 2.0 provider with multiple storage backends.
Add this to your Cargo.toml:
[dependencies]
oauth-provider-rs = "0.1.0-alpha.1"
use oauth_provider_rs::storage::{DefaultOAuthStorageFactory, OAuthStorageFactory};
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let factory = DefaultOAuthStorageFactory;
let mut config = HashMap::new();
config.insert("storage_type".to_string(), "memory".to_string());
let storage = factory.create_storage(&config).await?;
// Use the storage for OAuth operations
Ok(())
}
For production use with DynamoDB:
use oauth_provider_rs::storage::{DefaultOAuthStorageFactory, OAuthStorageFactory};
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let factory = DefaultOAuthStorageFactory;
let mut config = HashMap::new();
config.insert("storage_type".to_string(), "dynamodb".to_string());
config.insert("table_name".to_string(), "oauth-storage".to_string());
let storage = factory.create_storage(&config).await?;
Ok(())
}
use oauth_provider_rs::http_integration::OAuthRouterExt;
use axum::Router;
let app = Router::new()
.oauth_routes(storage);
Perfect for development and testing:
Production-ready with AWS DynamoDB:
File-based storage for small applications:
# Run unit tests
cargo test
# Run with DynamoDB integration tests (requires AWS credentials)
cargo test --features integration-tests
This project is licensed under the MIT License - see the LICENSE file for details.