Skip to main content

Crate rustauth_oauth_provider

Crate rustauth_oauth_provider 

Source
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§

mcp

Structs§

ClientPrivilegesInput
Input passed to the OAuth client privileges resolver.
ClientPrivilegesResolver
Async callback that authorizes OAuth client-management actions.
ClientReferenceInput
Input passed to the OAuth client reference resolver.
ClientReferenceResolver
Async callback that resolves the non-user owner of OAuth clients.
ClientSecretHashInput
Input passed to custom client secret hash callbacks.
ClientSecretHashResolver
Async callback that hashes client secrets before persistence.
ClientSecretVerifyInput
Input passed to custom client secret verification callbacks.
ClientSecretVerifyResolver
Async callback that verifies client secrets against stored values.
CustomAccessTokenClaimsInput
Input passed to custom access token claim callbacks.
CustomAccessTokenClaimsResolver
Async callback that provides additional access token or introspection claims.
CustomIdTokenClaimsInput
Input passed to custom ID token claim callbacks.
CustomIdTokenClaimsResolver
Async callback that provides additional ID token claims.
CustomTokenResponseFieldsInput
Input passed to custom token response field callbacks.
CustomTokenResponseFieldsResolver
Async callback that provides extra token response fields.
CustomUserInfoClaimsInput
Input passed to custom userinfo claim callbacks.
CustomUserInfoClaimsResolver
Async callback that provides additional userinfo claims.
JwtOptions
McpMetadataOverrides
Metadata extension points for MCP discovery responses.
McpOptions
MCP profile options. When enabled, the provider exposes MCP resource metadata.
OAuthProviderError
OAuth provider runtime error.
OAuthProviderOptions
User-facing OAuth provider plugin options.
OAuthProviderRateLimits
Rate-limit settings for OAuth provider endpoints.
OAuthTokenPrefixes
Optional public prefixes applied to generated OAuth secrets before returning them.
PromptRedirectInput
Input passed to advanced prompt redirect callbacks.
PromptRedirectResolver
Async callback that may redirect an advanced prompt step to a page.
PromptShouldRedirectResolver
Async callback that decides whether an advanced prompt step should run.
RefreshTokenFormatDecodeOutput
Output returned from custom refresh token decoders.
RefreshTokenFormatEncodeInput
Input passed to custom refresh token formatters.
RefreshTokenFormatter
Async callbacks that encode and decode refresh tokens returned to OAuth clients.
RequestUriResolver
Async callback that resolves pushed authorization request parameters.
RequestUriResolverInput
Input passed to request URI resolution.
ResolvedMcpOptions
Resolved MCP options stored on the plugin after validation.
ResolvedOAuthProviderOptions
Fully resolved OAuth provider options after upstream-compatible defaults.
StringGeneratorResolver
Async callback used to generate OAuth identifiers and token secrets.
TokenHashInput
Input passed to custom OAuth token hash callbacks.
TokenHashResolver
Async callback that hashes OAuth tokens before lookup or persistence.
TrustedClientCache

Enums§

ClientPrivilegeAction
OAuth client-management action checked by ClientPrivilegesResolver.
GrantType
Supported token endpoint grant types.
OAuthProviderConfigError
OAuth provider configuration errors.
OAuthProviderRateLimit
Per-endpoint OAuth provider rate-limit behavior.
SecretStorage
Storage strategy for OAuth provider secrets and tokens.
TokenEndpointAuthMethod
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.