Expand description
SAML 2.0 Authentication Module
Provides SAML 2.0 Single Sign-On (SSO) authentication support. This module implements the Service Provider (SP) side of SAML authentication.
§Features
- SAML AuthnRequest Generation: Create authentication requests to IdP
- SAML Response Validation: Parse and validate IdP responses
- Assertion Processing: Extract user information from SAML assertions
- Signature Verification: Verify XML signatures (with appropriate crypto)
- Metadata Support: Configure from IdP/SP metadata
§Example
ⓘ
use actix_security::http::security::saml::{SamlConfig, SamlAuthenticator};
let config = SamlConfig::new()
.entity_id("https://myapp.example.com/saml/metadata")
.idp_sso_url("https://idp.example.com/saml/sso")
.idp_certificate(include_str!("../idp-cert.pem"))
.sp_private_key(include_str!("../sp-key.pem"))
.assertion_consumer_service_url("https://myapp.example.com/saml/acs");
let authenticator = SamlAuthenticator::new(config);§SAML Flow
- User accesses protected resource
- SP generates AuthnRequest and redirects to IdP
- User authenticates at IdP
- IdP sends SAML Response back to SP’s ACS URL
- SP validates response and creates session
Structs§
- Authn
Request - SAML AuthnRequest
- Saml
Assertion - SAML Assertion
- Saml
Auth Result - Result of successful SAML authentication
- Saml
Authenticator - SAML Authenticator for actix-web
- Saml
Config - SAML Service Provider configuration
- Saml
Response - SAML Response
Enums§
- Authn
Context Class - SAML 2.0 authentication context classes
- Name
IdFormat - SAML 2.0 name ID formats
- Saml
Binding - SAML 2.0 binding types
- Saml
Error - SAML authentication error
- Saml
Status Code - SAML Status codes