Expand description
Server-side enterprise single sign-on support for RustAuth.
The crate exposes an RustAuth plugin that adds Better Auth-compatible SSO provider management, OIDC sign-in, SAML ACS, SAML metadata, domain verification, and SAML single logout endpoints.
§SAML support
SAML 2.0 SP flows (sign-in, ACS, metadata, SLO) are implemented via the
[rustauth_saml] crate and the pinned opensaml dependency. Enable the
saml feature on this crate; use saml-signed on [rustauth_saml] for
XMLDSig and XML-Enc. Without saml-signed, signed or encrypted IdP messages
are rejected fail-closed.
§Example
use rustauth_sso::{sso, SsoOptions};
let plugin = sso(SsoOptions::default());
assert_eq!(plugin.id, "sso");Re-exports§
pub use linking::NormalizedSsoProfile;
Modules§
- linking
- Stable SSO account-linking helpers.
Structs§
- Create
SsoProvider Input - Input used to create an SSO provider record.
- DnsTxt
Resolver - Async resolver used to verify domain ownership through DNS TXT records.
- Domain
Verification Options - Domain verification behavior for registered SSO providers.
- Oidc
Options - OIDC runtime and security behavior for SSO providers.
- Oidc
Profile Mapping - Mapping from OIDC claims to RustAuth profile fields.
- Oidc
Provider Config - OIDC configuration for an enterprise SSO provider.
- Organization
Provisioning Options - Controls automatic organization membership assignment for SSO users.
- Organization
Role Input - Input passed to organization role resolution after a successful SSO login.
- Organization
Role Resolver - Async callback that maps an SSO login to an organization role.
- Providers
Limit Resolver - Async resolver used to compute a per-user dynamic provider limit.
- Provision
User Input - Input passed to the
provision_userhook. - Provision
User Resolver - Async hook invoked after an SSO user is created or linked.
- Saml
Algorithm Options - SAML algorithm allow lists and deprecated algorithm behavior.
- Saml
Config - SAML configuration for an SSO provider.
- Saml
IdpMetadata - IdP metadata fields accepted by SAML provider configuration.
- Saml
Mapping - Mapping from SAML attributes to RustAuth profile fields.
- Saml
Options - Runtime and security options for SAML flows.
- Saml
Service - SAML metadata service endpoint.
- Saml
SpMetadata - Service provider metadata overrides.
- Sanitized
SsoProvider - Provider representation returned by public read endpoints.
- Secret
String - Secret string wrapper that redacts its value in
Debugoutput. - SsoAudit
Event - Audit event emitted by the SSO plugin.
- SsoAudit
Event Resolver - Async sink for SSO audit events.
- SsoError
Descriptor - Descriptor for a stable SSO error code registered by the plugin.
- SsoOptions
- Configuration for the RustAuth SSO plugin.
- SsoProvider
- Static SSO provider definition used by
SsoOptions::default_sso. - SsoProvider
Record - Raw SSO provider record loaded from the adapter.
- SsoProvider
Store - Adapter-backed store for SSO provider records.
- SsoRate
Limit Options - Rate limit rules contributed by the SSO plugin.
Enums§
- Deprecated
Algorithm Behavior - Behavior used when SAML algorithms are deprecated.
- SsoAudit
Event Kind - SSO audit event kind emitted by provider, domain, SAML, and SLO flows.
- SsoAudit
Severity - Severity level for SSO audit events.
- SsoError
Category - High-level category for stable public SSO error codes.
- Token
Endpoint Authentication - Supported OAuth token endpoint authentication methods.
Constants§
- DEFAULT_
MAX_ SAML_ METADATA_ SIZE - Default maximum accepted IdP metadata XML size (100 KiB).
- DEFAULT_
MAX_ SAML_ RESPONSE_ SIZE - Default maximum accepted base64 SAML response size (256 KiB).
- UPSTREAM_
PLUGIN_ ID - Better Auth upstream plugin identifier used for endpoint and schema parity.
- VERSION
- Current crate version.
Functions§
- sso
- Build the server-side SSO plugin.
- sso_
error_ category - Look up the high-level category for a stable SSO error code.
- sso_
error_ descriptors - Return all SSO error descriptors known by the plugin.
Type Aliases§
- Oidc
Config - Backward-compatible OIDC provider config alias.
- Oidc
Mapping - Backward-compatible OIDC mapping alias.