Skip to main content

Crate openauth_oauth_provider

Crate openauth_oauth_provider 

Source
Expand description

OAuth 2.1 and OpenID Connect provider support for OpenAuth.

This crate ports the server-side Better Auth oauth-provider behavior into idiomatic Rust. It is intentionally separate from openauth-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.
ConsentGrantInput
Input for creating or updating an OAuth consent grant.
CreateOAuthClientInput
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.
OAuthAccessToken
Stored opaque OAuth access token row.
OAuthClient
OAuth 2.0 Dynamic Client Registration payload/response.
OAuthConsent
Stored OAuth consent row.
OAuthProviderError
OAuth provider runtime error.
OAuthProviderOptions
User-facing OAuth provider plugin options.
OAuthProviderPlugin
OAuth provider extension returned by crate::oauth_provider.
OAuthProviderRateLimits
Rate-limit settings for OAuth provider endpoints.
OAuthRefreshToken
Stored OAuth refresh token row.
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.
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.
ResolvedOAuthProviderOptions
Fully resolved OAuth provider options after upstream-compatible defaults.
SchemaClient
Stored OAuth client row.
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.
TokenResponse
TrustedClientCache

Enums§

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

OAUTH_ACCESS_TOKEN_MODEL
OAUTH_CLIENT_MODEL
OAUTH_CONSENT_MODEL
OAUTH_REFRESH_TOKEN_MODEL
VERSION
Current crate version.

Functions§

auth_server_metadata
check_oauth_client
create_client_credentials_token
decide_authorize
decode_refresh_token
delete_consent
find_consent
has_granted_scopes
oauth_provider
Build the OAuth provider extension.
oauth_provider_schema
Database schema contributions for the OAuth provider plugin.
oauth_to_schema
oidc_server_metadata
schema_to_oauth
store_client_secret
store_token
upsert_consent
verify_client_secret