pub struct IdentityProvider {
pub setting: EntitySetting,
pub metadata: IdpMetadata,
}Expand description
A SAML 2.0 Identity Provider: runtime EntitySetting plus parsed IdpMetadata.
Fields§
§setting: EntitySettingRuntime configuration (keys, algorithms, flags).
metadata: IdpMetadataParsed IdP metadata.
Implementations§
Source§impl IdentityProvider
impl IdentityProvider
Sourcepub fn from_metadata(
xml: &str,
setting: EntitySetting,
) -> Result<IdentityProvider, OpenSamlError>
pub fn from_metadata( xml: &str, setting: EntitySetting, ) -> Result<IdentityProvider, OpenSamlError>
Build from IdP metadata XML, merging metadata-declared flags into setting.
Sourcepub fn from_config(
config: &IdpMetadataConfig,
setting: EntitySetting,
) -> Result<IdentityProvider, OpenSamlError>
pub fn from_config( config: &IdpMetadataConfig, setting: EntitySetting, ) -> Result<IdentityProvider, OpenSamlError>
Build by generating IdP metadata from config, then importing it.
Sourcepub fn metadata_xml(&self) -> &str
pub fn metadata_xml(&self) -> &str
The IdP metadata XML.
Sourcepub fn create_login_response(
&self,
sp: &ServiceProvider,
binding: Binding,
user: &User,
options: &LoginResponseOptions<'_>,
) -> Result<BindingContext, OpenSamlError>
pub fn create_login_response( &self, sp: &ServiceProvider, binding: Binding, user: &User, options: &LoginResponseOptions<'_>, ) -> Result<BindingContext, OpenSamlError>
Generate a login <Response> for sp over binding (samlify createLoginResponse).
Requires the crypto-bergshamra feature: the response is always signed
(assertion- or message-level) and optionally encrypted. Attributes are
taken from user; options carries InResponseTo, RelayState, the
encrypt-then-sign toggle, and an optional customTagReplacement hook.
Sourcepub fn parse_login_request(
&self,
sp: &ServiceProvider,
binding: Binding,
request: &HttpRequest,
) -> Result<FlowResult, OpenSamlError>
pub fn parse_login_request( &self, sp: &ServiceProvider, binding: Binding, request: &HttpRequest, ) -> Result<FlowResult, OpenSamlError>
Parse and validate an SP login <AuthnRequest> (samlify parseLoginRequest).
Trait Implementations§
Source§impl Clone for IdentityProvider
impl Clone for IdentityProvider
Source§fn clone(&self) -> IdentityProvider
fn clone(&self) -> IdentityProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IdentityProvider
impl RefUnwindSafe for IdentityProvider
impl Send for IdentityProvider
impl Sync for IdentityProvider
impl Unpin for IdentityProvider
impl UnsafeUnpin for IdentityProvider
impl UnwindSafe for IdentityProvider
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
Mutably borrows from an owned value. Read more