OAuth2 for Rust Done Right.

Elegant, async-first, and Developer Experience (DX) focused authentication library. Easily integrate social logins across Axum, Actix, Leptos, and more.

cargo add rullst-connect Copied!
Get Started
Crates.io Downloads License

Why Rullst Connect?

Built for the modern Rust web ecosystem with a focus on simplicity and security.

🚀

Async & Fast

Built entirely on top of tokio and reqwest for non-blocking, high-performance authentication flows.

🧩

Standardized

All providers return a unified ConnectUser struct, making it easy to switch or support multiple providers.

🔌

Framework Agnostic

Works seamlessly with your favorite frameworks: Axum, Actix, Leptos, Dioxus, or vanilla Rust.

🔐

Enterprise Security

Built-in OIDC Discovery, JWKS validation, automatic CSRF protection, and native PKCE support.

Supported Providers

Out-of-the-box support for the most popular social login platforms.

Google GitHub Microsoft / Azure AD Apple Auth0 AWS Cognito Facebook X (Twitter) Discord LinkedIn Custom OIDC

Quick Start

Three simple steps to authenticate your users.

main.rs
use rullst_connect::prelude::*;

// 1. Initialize the Provider
let github = GithubProvider::new(
    "CLIENT_ID".to_string(),
    "CLIENT_SECRET".to_string(),
    "http://localhost:3000/auth/callback".to_string(),
);

// 2. Redirect the User
let url = github.redirect_url();
// Return this URL as a redirect to the user

// 3. Handle the Callback
let params = ExchangeParams { auth_code: code, ..Default::default() };
if let Ok(user) = github.get_user(params).await {
    println!("Welcome, {}!", user.name);
    println!("Email: {:?}", user.email);
}