Struct saml_rs::metadata::SamlMetadata
source · [−]pub struct SamlMetadata {
pub hostname: String,
pub baseurl: String,
pub entity_id: String,
pub logout_suffix: String,
pub redirect_suffix: String,
pub post_suffix: String,
pub x509_certificate: Option<X509>,
}
Expand description
Stores the required data for generating a SAML metadata XML file
Fields
hostname: String
Hostname of the issuer, used for URLs etc
baseurl: String
Set this as the base of the suffix-items elsewhere
entity_id: String
entityID is transmitted in all requests
Every SAML system entity has an entity ID, a globally-unique identifier used in software configurations, relying-party databases, and client-side cookies. On the wire, every SAML protocol message contains the entity ID of the issuer. If you don’t set it, it’ll fall back to the bare hostname.
logout_suffix: String
Appended to the baseurl when using the SamlMetadata::logout_url function
redirect_suffix: String
Appended to the baseurl when using the SamlMetadata::redirect_url function
post_suffix: String
Appended to the baseurl when using the SamlMetadata::post_url function
x509_certificate: Option<X509>
Public certificate for signing/encryption
Implementations
sourceimpl SamlMetadata
impl SamlMetadata
sourcepub fn new(
hostname: &str,
baseurl: Option<String>,
entity_id: Option<String>,
logout_suffix: Option<String>,
redirect_suffix: Option<String>,
post_suffix: Option<String>,
x509_certificate: Option<X509>
) -> Self
pub fn new(
hostname: &str,
baseurl: Option<String>,
entity_id: Option<String>,
logout_suffix: Option<String>,
redirect_suffix: Option<String>,
post_suffix: Option<String>,
x509_certificate: Option<X509>
) -> Self
Create a new SamlMetadata object for your IdP
sourcepub fn from_hostname(hostname: &str) -> SamlMetadata
pub fn from_hostname(hostname: &str) -> SamlMetadata
really simple version with a self-signed certificate based on just the hostname. Mainly for testing.
sourcepub fn logout_url(&self) -> String
pub fn logout_url(&self) -> String
return the generated Logout URL based on the baseurl + logout_suffix
sourcepub fn redirect_url(&self) -> String
pub fn redirect_url(&self) -> String
return the generated redirect URL based on the baseurl + redirect_suffix