Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Sustainsys.​Saml2.​Saml2P.​Saml2Response
Assembly: Sustainsys.Saml2
Inheritance: object → Saml2Response
Implemented Interfaces
Represents a SAML2 response according to 3.3.3. The class is immutable (to an external observer. Internal state is lazy initiated).
Properties
SigningCertificate
Certificate used to sign the message with during binding, according
to the signature processing rules of each binding.
public
string
SigningAlgorithm
The signing algorithm to use when signing the message during binding,
according to the signature processing rules of each binding.
XmlElement
The response as an xml element. Either the original xml, or xml that is
generated from supplied data.
public
string
MessageName
SAML Message name for responses, hard coded to SAMLResponse.
Id of the response message.
ExpectedInResponseTo
Expected InResponseTo as extracted from
InResponseTo
InResponseTo id.
IssueInstant
Issue instant of the response message.
public
Saml2StatusCode
Status
Status code of the message according to the SAML2 spec section 3.2.2.2
public
string
StatusMessage
StatusMessage of the message according to the SAML2 spec section 3.2.2.1
public
string
SecondLevelStatus
Optional status which MAY give additional information about the cause of the problem (according to the SAML2 spec section 3.2.2.2))))))))).
Because it may change in future specifications let's not make enum out of it yet.
Issuer
Issuer (= sender) of the response.
public
System.​Uri
DestinationUrl
The destination of the response message.
public
string
RelayState
RelayState attached to the message.
public
System.​DateTime?
SessionNotOnOrAfter
Session termination time for a session generated from this
response.
Methods
public static
Saml2Response
Read​(string xml)
Read the supplied Xml and parse it into a response.
Returns Saml2Response
xml
xml data.
public static
Saml2Response
Read​(string xml,
Microsoft.​IdentityModel.​Tokens.​Saml2.​Saml2Id expectedInResponseTo)
Read the supplied Xml and parse it into a response.
Returns Saml2Response
xml
xml data.
expectedInResponseTo
The expected value of the
InReplyTo parameter in the message.
public static
Saml2Response
Read​(string xml,
Microsoft.​IdentityModel.​Tokens.​Saml2.​Saml2Id expectedInResponseTo,
Configuration.​IOptions options)
Read the supplied Xml and parse it into a response.
Returns Saml2Response
xml
xml data.
expectedInResponseTo
The expected value of the
InReplyTo parameter in the message.
options
Service provider settings used when validating Saml response
ToXElement​()
Transforms the message to an XElement object tree.
Returns XElement with Xml representation of the message
Remarks
This operation is inefficient, but it is only used by
the StubIdp so it's acceptable.
public
string
ToXml​()
string representation of the Saml2Response serialized to xml.
Returns string containing xml.
public
System.​Collections.​Generic.​IEnumerable<​System.​Security.​Claims.​ClaimsIdentity>
GetClaims​(Configuration.​IOptions options)
Extract claims from the assertions contained in the response.
Returns ClaimsIdentities
options
Service provider settings used when processing the response into claims.
public
System.​Collections.​Generic.​IEnumerable<​System.​Security.​Claims.​ClaimsIdentity>
GetClaims​(Configuration.​IOptions options,
System.​Collections.​Generic.​IDictionary<​string, string> relayData)
Extract claims from the assertions contained in the response.
Returns ClaimsIdentities
options
Service provider settings used when processing the response into claims.
relayData
Relay data stored when creating AuthnRequest, to be passed on to
GetIdentityProvider notification.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object