Expand description
OAuth 2.0 authentication primitives for the Aether agent framework.
§Architecture
OAuthHandler– Trait implemented by consuming applications to handle OAuth UI/UX. The handler opens a browser and waits for the authorization code on a local port.BrowserOAuthHandler– Default implementation that opens the system browser and listens on a dynamic local port.OAuthCredentialStorage– Trait for persisting OAuth credentials keyed by provider ID, MCP server ID, or another credential key.- [
OsKeyringStore] – OS-keychain-backedOAuthCredentialStorage(macOS Keychain, Windows Credential Manager, Linux/FreeBSD Secret Service). Available under thekeyringfeature. FakeOAuthCredentialStore– In-memory storage for tests.
Behind the mcp feature:
- [
McpCredentialStore] – Per-server adapter that binds anOAuthCredentialStorageto one MCP server ID and implementsrmcp::transport::auth::CredentialStore. - [
perform_oauth_flow] – Orchestrates the full MCP authorization code flow: browser launch, callback capture, token exchange, and credential storage. - [
create_auth_manager_from_store] – Build anAuthorizationManagerfrom stored credentials, handling automatic token refresh.
§Errors
All OAuth-specific errors are represented by OAuthError.
Re-exports§
pub use error::OAuthError;
Modules§
Structs§
- BrowserO
Auth Handler - Default
OAuthHandlerthat opens the system browser and listens for the OAuth callback on a dynamically-assigned local port. - FakeO
Auth Credential Store - OAuth
Callback - OAuth callback data containing both the authorization code and state (CSRF token)
- OAuth
Credential - Credential for an OAuth provider.
Traits§
- OAuth
Credential Storage - Trait for loading and saving OAuth credentials, keyed by provider ID or credential key.
- OAuth
Handler - Trait that consuming applications implement to handle OAuth UI/UX.
Functions§
- accept_
oauth_ callback - Accept an OAuth callback on an already-bound listener.
- oauth_
http_ client - open_
browser - Open a URL in the default browser
- wait_
for_ callback - Start a local callback server to capture the OAuth authorization code and state