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 returns the absolute callback URL.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. EncryptedFileOAuthCredentialStorage– File-backedOAuthCredentialStoragethat encrypts the file withage. The passphrase is read from an environment variable.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] – Integrates Aether’s browser/callback UI withrmcp’s MCP OAuth state machine.rmcpprovides discovery, registration selection (pre-registered client, CIMD, then DCR), PKCE, resource indicators, scope selection and unioning, refresh, and issuer validation. - [
create_auth_manager_from_store] – Build an issuer-boundAuthorizationManagerfrom stored credentials, handling automatic token refresh and rejecting credentials minted by a different authorization server.
§Errors
All OAuth-specific errors are represented by OAuthError.
Re-exports§
pub use encrypted_file::EncryptedFileOAuthCredentialStorage;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
Credential - Credential for a non-MCP OAuth provider.
Traits§
- OAuth
Credential Storage - Storage for namespaced, opaque OAuth JSON values.
- OAuth
Handler - UI boundary for interactive OAuth authorization.
Functions§
- accept_
oauth_ callback - Accept an OAuth callback and return its absolute URL.
- oauth_
http_ client - open_
browser - Open a URL in the default browser.
- wait_
for_ callback - Start a local callback server and return the OAuth callback URL.