| Crates.io | libclientauth-rs |
| lib.rs | libclientauth-rs |
| version | 0.1.0 |
| created_at | 2025-12-17 15:50:14.338103+00 |
| updated_at | 2025-12-17 15:50:14.338103+00 |
| description | Client side authentication library |
| homepage | |
| repository | https://github.com/strangelightstudios/strl1.git |
| max_upload_size | |
| id | 1990581 |
| size | 90,802 |
[!CAUTION] The content of this repository is publicly accessible; follow the guidelines in RFC 545 (internal document)
A client-side authentication library for Rust that implements OAuth2 authentication with PKCE (Proof Key for Code Exchange).
libclientauth-rs provides a simple and secure way to implement OAuth2 authentication flows in your Rust applications. The library includes built-in PKCE support for enhanced security.
Add this to your Cargo.toml:
[dependencies]
libclientauth-rs = "0.1.0"
cli - Enables CLI support with built-in listener (default)stytch - Enables Stytch provider support (default)std - Standard library supportDefault features: ["cli", "stytch"]
The library provides traits for implementing authentication:
use libclientauth_rs::{Auth, Callback};
// Start authentication
let auth_url = provider.start().await?;
// Handle callback after user authorization
let token = provider.handle(callback_url, &verifier, &csrf_token).await?;
Exchange an authorization code for an access token:
use libclientauth_rs::exchange_code_for_token;
let token = exchange_code_for_token(
"https://your-domain.com/oauth2/token",
"your_client_id",
"authorization_code",
"http://localhost:3000/callback",
"code_verifier"
).await?;
This library implements PKCE (Proof Key for Code Exchange) as defined in RFC 7636, which provides additional security for OAuth2 flows, especially for public clients.
Learn more about PKCE: https://blog.postman.com/what-is-pkce/
MIT