pub struct SsoOptions {Show 17 fields
pub model_name: String,
pub provider_table: String,
pub providers_limit: usize,
pub providers_limit_callback: Option<ProvidersLimitResolver>,
pub domain_verification: DomainVerificationOptions,
pub redirect_uri: Option<String>,
pub disable_implicit_sign_up: bool,
pub trust_email_verified: bool,
pub default_override_user_info: bool,
pub oidc: OidcOptions,
pub provision_user: Option<ProvisionUserResolver>,
pub provision_user_on_every_login: bool,
pub organization_provisioning: OrganizationProvisioningOptions,
pub saml: SamlOptions,
pub rate_limit: SsoRateLimitOptions,
pub audit_event: Option<SsoAuditEventResolver>,
pub default_sso: Vec<SsoProvider>,
}Expand description
Configuration for the RustAuth SSO plugin.
Fields§
§model_name: StringLogical schema model name contributed by the plugin.
provider_table: StringPhysical database table name for SSO providers.
providers_limit: usizeStatic maximum number of providers a user may register.
providers_limit_callback: Option<ProvidersLimitResolver>Optional dynamic provider limit resolver.
domain_verification: DomainVerificationOptionsDomain verification settings.
redirect_uri: Option<String>Shared OIDC redirect URI override.
disable_implicit_sign_up: boolDisable implicit user creation during SSO login.
trust_email_verified: boolTrust IdP email verification for implicit account linking.
default_override_user_info: boolDefault value for provider-level user info override behavior.
oidc: OidcOptionsOIDC runtime and security settings.
provision_user: Option<ProvisionUserResolver>Optional hook for application-specific user provisioning.
provision_user_on_every_login: boolRun provision_user for existing users on every login.
organization_provisioning: OrganizationProvisioningOptionsOrganization provisioning settings.
saml: SamlOptionsSAML runtime and security settings.
rate_limit: SsoRateLimitOptionsPlugin rate limit settings.
audit_event: Option<SsoAuditEventResolver>Optional audit event sink.
default_sso: Vec<SsoProvider>Statically configured SSO providers.
Implementations§
Source§impl SsoOptions
impl SsoOptions
Sourcepub fn provider_table(self, table: impl Into<String>) -> Self
pub fn provider_table(self, table: impl Into<String>) -> Self
Override the physical provider table name.
Sourcepub fn providers_limit(self, limit: usize) -> Self
pub fn providers_limit(self, limit: usize) -> Self
Set the static maximum provider count per user.
Sourcepub fn providers_limit_callback<F, Fut>(self, resolver: F) -> Self
pub fn providers_limit_callback<F, Fut>(self, resolver: F) -> Self
Set a dynamic provider limit callback.
Sourcepub async fn resolve_providers_limit(
&self,
user: User,
) -> Result<usize, RustAuthError>
pub async fn resolve_providers_limit( &self, user: User, ) -> Result<usize, RustAuthError>
Resolve the effective provider limit for a user.
Sourcepub fn domain_verification_enabled(self, enabled: bool) -> Self
pub fn domain_verification_enabled(self, enabled: bool) -> Self
Enable or disable DNS domain verification.
Sourcepub fn domain_txt_resolver<F, Fut>(self, resolver: F) -> Self
pub fn domain_txt_resolver<F, Fut>(self, resolver: F) -> Self
Set a custom DNS TXT resolver for domain verification.
Sourcepub fn redirect_uri(self, redirect_uri: impl Into<String>) -> Self
pub fn redirect_uri(self, redirect_uri: impl Into<String>) -> Self
Override the OIDC redirect URI used in authorization requests.
Sourcepub fn organization_provisioning(
self,
provisioning: OrganizationProvisioningOptions,
) -> Self
pub fn organization_provisioning( self, provisioning: OrganizationProvisioningOptions, ) -> Self
Configure organization provisioning.
Sourcepub fn provision_user<F, Fut>(self, resolver: F) -> Selfwhere
F: Fn(ProvisionUserInput) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<(), RustAuthError>> + Send + 'static,
pub fn provision_user<F, Fut>(self, resolver: F) -> Selfwhere
F: Fn(ProvisionUserInput) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<(), RustAuthError>> + Send + 'static,
Set a user provisioning hook.
Sourcepub fn provision_user_on_every_login(self, enabled: bool) -> Self
pub fn provision_user_on_every_login(self, enabled: bool) -> Self
Run the provisioning hook for existing users on every login.
Sourcepub fn rate_limit(self, rate_limit: SsoRateLimitOptions) -> Self
pub fn rate_limit(self, rate_limit: SsoRateLimitOptions) -> Self
Replace all SSO rate limit settings.
Sourcepub fn rate_limit_enabled(self, enabled: bool) -> Self
pub fn rate_limit_enabled(self, enabled: bool) -> Self
Enable or disable SSO rate limit rule contributions.
Sourcepub fn audit_event<F, Fut>(self, resolver: F) -> Self
pub fn audit_event<F, Fut>(self, resolver: F) -> Self
Set an async audit event sink.
Sourcepub fn strict_oidc_manual_endpoint_origins(self, enabled: bool) -> Self
pub fn strict_oidc_manual_endpoint_origins(self, enabled: bool) -> Self
Require manually configured OIDC endpoints to match trusted origins.
Sourcepub fn allow_private_endpoint_ips(self, enabled: bool) -> Self
pub fn allow_private_endpoint_ips(self, enabled: bool) -> Self
Allow OIDC outbound requests to resolve to private or internal IPs.
Leave disabled (the default) to keep SSRF protection active. Enable only when identity providers are intentionally hosted on a private network.
Trait Implementations§
Source§impl Clone for SsoOptions
impl Clone for SsoOptions
Source§fn clone(&self) -> SsoOptions
fn clone(&self) -> SsoOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SsoOptions
impl Debug for SsoOptions
Source§impl Default for SsoOptions
impl Default for SsoOptions
Source§impl<'de> Deserialize<'de> for SsoOptions
impl<'de> Deserialize<'de> for SsoOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SsoOptions
Source§impl PartialEq for SsoOptions
impl PartialEq for SsoOptions
Source§fn eq(&self, other: &SsoOptions) -> bool
fn eq(&self, other: &SsoOptions) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SsoOptions
impl Serialize for SsoOptions
impl StructuralPartialEq for SsoOptions
Auto Trait Implementations§
impl !RefUnwindSafe for SsoOptions
impl !UnwindSafe for SsoOptions
impl Freeze for SsoOptions
impl Send for SsoOptions
impl Sync for SsoOptions
impl Unpin for SsoOptions
impl UnsafeUnpin for SsoOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more