pub struct SamlResponse {
pub id: String,
pub in_response_to: Option<String>,
pub issue_instant: String,
pub destination: Option<String>,
pub issuer: String,
pub status_code: SamlStatusCode,
pub status_message: Option<String>,
pub assertions: Vec<SamlAssertion>,
}Expand description
SAML Response
Fields§
§id: StringResponse ID
in_response_to: Option<String>In response to (AuthnRequest ID)
issue_instant: StringIssue instant
destination: Option<String>Destination
issuer: StringIssuer (IdP Entity ID)
status_code: SamlStatusCodeStatus code
status_message: Option<String>Status message
assertions: Vec<SamlAssertion>Assertion(s)
Implementations§
Source§impl SamlResponse
impl SamlResponse
Sourcepub fn from_base64(encoded: &str) -> Result<SamlResponse, SamlError>
pub fn from_base64(encoded: &str) -> Result<SamlResponse, SamlError>
Parse a SAML Response from base64-encoded XML
Note: In production, you should use a proper XML/SAML library
like samael or saml2 for full parsing and signature verification.
Sourcepub fn from_xml(xml: &str) -> Result<SamlResponse, SamlError>
pub fn from_xml(xml: &str) -> Result<SamlResponse, SamlError>
Parse a SAML Response from XML string
Note: This is a simplified parser. In production, use a proper XML library with namespace support and signature verification.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the response indicates success
Sourcepub fn assertion(&self) -> Option<&SamlAssertion>
pub fn assertion(&self) -> Option<&SamlAssertion>
Get the first assertion (most common case)
Trait Implementations§
Source§impl Clone for SamlResponse
impl Clone for SamlResponse
Source§fn clone(&self) -> SamlResponse
fn clone(&self) -> SamlResponse
Returns a duplicate of the value. Read more
1.0.0 · 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 SamlResponse
impl RefUnwindSafe for SamlResponse
impl Send for SamlResponse
impl Sync for SamlResponse
impl Unpin for SamlResponse
impl UnwindSafe for SamlResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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