Expand description
OAuth 2.1 and OpenID Connect provider support for RustAuth.
This crate ports the server-side Better Auth oauth-provider behavior into
idiomatic Rust. It is intentionally separate from rustauth-oauth, which
contains OAuth client and social-provider primitives.
Modules§
Structs§
- Client
Privileges Input - Input passed to the OAuth client privileges resolver.
- Client
Privileges Resolver - Async callback that authorizes OAuth client-management actions.
- Client
Reference Input - Input passed to the OAuth client reference resolver.
- Client
Reference Resolver - Async callback that resolves the non-user owner of OAuth clients.
- Client
Secret Hash Input - Input passed to custom client secret hash callbacks.
- Client
Secret Hash Resolver - Async callback that hashes client secrets before persistence.
- Client
Secret Verify Input - Input passed to custom client secret verification callbacks.
- Client
Secret Verify Resolver - Async callback that verifies client secrets against stored values.
- Custom
Access Token Claims Input - Input passed to custom access token claim callbacks.
- Custom
Access Token Claims Resolver - Async callback that provides additional access token or introspection claims.
- Custom
IdToken Claims Input - Input passed to custom ID token claim callbacks.
- Custom
IdToken Claims Resolver - Async callback that provides additional ID token claims.
- Custom
Token Response Fields Input - Input passed to custom token response field callbacks.
- Custom
Token Response Fields Resolver - Async callback that provides extra token response fields.
- Custom
User Info Claims Input - Input passed to custom userinfo claim callbacks.
- Custom
User Info Claims Resolver - Async callback that provides additional userinfo claims.
- JwtOptions
- McpMetadata
Overrides - Metadata extension points for MCP discovery responses.
- McpOptions
- MCP profile options. When enabled, the provider exposes MCP resource metadata.
- OAuth
Provider Error - OAuth provider runtime error.
- OAuth
Provider Options - User-facing OAuth provider plugin options.
- OAuth
Provider Rate Limits - Rate-limit settings for OAuth provider endpoints.
- OAuth
Token Prefixes - Optional public prefixes applied to generated OAuth secrets before returning them.
- Prompt
Redirect Input - Input passed to advanced prompt redirect callbacks.
- Prompt
Redirect Resolver - Async callback that may redirect an advanced prompt step to a page.
- Prompt
Should Redirect Resolver - Async callback that decides whether an advanced prompt step should run.
- Refresh
Token Format Decode Output - Output returned from custom refresh token decoders.
- Refresh
Token Format Encode Input - Input passed to custom refresh token formatters.
- Refresh
Token Formatter - Async callbacks that encode and decode refresh tokens returned to OAuth clients.
- Request
UriResolver - Async callback that resolves pushed authorization request parameters.
- Request
UriResolver Input - Input passed to request URI resolution.
- Resolved
McpOptions - Resolved MCP options stored on the plugin after validation.
- ResolvedO
Auth Provider Options - Fully resolved OAuth provider options after upstream-compatible defaults.
- String
Generator Resolver - Async callback used to generate OAuth identifiers and token secrets.
- Token
Hash Input - Input passed to custom OAuth token hash callbacks.
- Token
Hash Resolver - Async callback that hashes OAuth tokens before lookup or persistence.
- Trusted
Client Cache
Enums§
- Client
Privilege Action - OAuth client-management action checked by
ClientPrivilegesResolver. - Grant
Type - Supported token endpoint grant types.
- OAuth
Provider Config Error - OAuth provider configuration errors.
- OAuth
Provider Rate Limit - Per-endpoint OAuth provider rate-limit behavior.
- Secret
Storage - Storage strategy for OAuth provider secrets and tokens.
- Token
Endpoint Auth Method - OAuth token endpoint client authentication method.
Constants§
- VERSION
- Current crate version.
Functions§
- apply_
jwt_ metadata_ defaults - Apply JWT-derived metadata defaults to resolved OAuth provider options.
- oauth_
provider - Build the OAuth provider plugin.
- resolve_
oauth_ provider_ options - Resolve and validate OAuth provider options without building the plugin.