origin-auth-loopback 0.2.0

Loopback redirect listener for the OAuth authorization code flow (RFC 8252).
Documentation

origin-auth-loopback

Local loopback redirect listener for OAuth authorization flows (ADR-0015, RFC 8252).

Part of Origin, a Rust/Tauri platform for building desktop applications from a shared set of domain crates. See the workspace documentation for how the pieces fit together, and ARCHITECTURE.md for the rules this crate follows.

Example

use origin_auth::RedirectListener;
use origin_auth_loopback::LoopbackRedirect;

// Binds an ephemeral port on 127.0.0.1:0
let listener = LoopbackRedirect::bind().await?;
let redirect_uri = listener.redirect_uri();

// Await the authorization callback from the browser
let code = listener.await_code().await?;

Binds an ephemeral port on 127.0.0.1, captures exactly one OAuth redirect from the system browser, renders a success response, and shuts down immediately without leaving open sockets or requiring custom OS URL scheme registrations.

Stability

Pre-1.0 (0.2.0). Public types, enums and field sets may still change between minor versions; pin an exact version if that matters to you.