Class AuthnRequest
Represents an authentication request.
Inherited Members
Namespace: ComponentSpace.SAML2.Protocols
Assembly: ComponentSpace.Saml2.dll
Syntax
public class AuthnRequest : RequestAbstractType
  Remarks
Refer to the Assertions and Protocol for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.
Constructors
AuthnRequest()
Initializes a new instance of the AuthnRequest class.
Declaration
public AuthnRequest()
  AuthnRequest(XmlElement)
Initializes a new instance of the AuthnRequest class from XML.
Declaration
public AuthnRequest(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | xmlElement | The authentication request XML.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML deserialization fails.  | 
      
Properties
AssertionConsumerServiceIndex
Gets or sets the assertion consumer service index.
Declaration
public int AssertionConsumerServiceIndex { get; set; }
  Property Value
| Type | Description | 
|---|---|
| int | The assertion consumer service index or negative if none.  | 
      
AssertionConsumerServiceURL
Gets or sets the assertion consumer service URL.
Declaration
public string AssertionConsumerServiceURL { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The assertion consumer service URL.  | 
      
AttributeConsumingServiceIndex
Gets or sets the attribute consuming service index.
Declaration
public int AttributeConsumingServiceIndex { get; set; }
  Property Value
| Type | Description | 
|---|---|
| int | The attribute consuming service index or negative if none.  | 
      
Conditions
Gets or sets the conditions.
Declaration
public Conditions Conditions { get; set; }
  Property Value
| Type | Description | 
|---|---|
| Conditions | The conditions.  | 
      
ForceAuthn
Gets or sets the force authentication flag.
Declaration
public bool ForceAuthn { get; set; }
  Property Value
| Type | Description | 
|---|---|
| bool | The force authentication flag.  | 
      
IsPassive
Gets or sets the is passive flag.
Declaration
public bool IsPassive { get; set; }
  Property Value
| Type | Description | 
|---|---|
| bool | The is passive flag.  | 
      
NameIDPolicy
Gets or sets the name ID policy.
Declaration
public NameIDPolicy NameIDPolicy { get; set; }
  Property Value
| Type | Description | 
|---|---|
| NameIDPolicy | The name ID policy.  | 
      
ProtocolBinding
Gets or sets the protocol binding.
Declaration
public string ProtocolBinding { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The protocol binding.  | 
      
ProviderName
Gets or sets the provider name.
Declaration
public string ProviderName { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The provider name.  | 
      
RequestedAuthnContext
Gets or sets the requested authentication context.
Declaration
public RequestedAuthnContext RequestedAuthnContext { get; set; }
  Property Value
| Type | Description | 
|---|---|
| RequestedAuthnContext | The requested authentication context.  | 
      
Scoping
Gets or sets the scoping.
Declaration
public Scoping Scoping { get; set; }
  Property Value
| Type | Description | 
|---|---|
| Scoping | The scoping.  | 
      
Subject
Gets or sets the subject.
Declaration
public Subject Subject { get; set; }
  Property Value
| Type | Description | 
|---|---|
| Subject | The subject.  | 
      
Methods
IsValid(XmlElement)
Indicates whether the XML is an authentication request.
Declaration
public static bool IsValid(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | xmlElement | The XML to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
ToString()
Converts the authentication request to a string.
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| string | The authentication request as a string.  | 
      
Overrides
ToXml()
Serializes the authentication request to XML.
Declaration
public XmlElement ToXml()
  Returns
| Type | Description | 
|---|---|
| XmlElement | The authentication request as XML.  | 
      
Remarks
An XML document is created.
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML serialization fails.  | 
      
ToXml(XmlDocument)
Serializes the authentication request to XML.
Declaration
public XmlElement ToXml(XmlDocument xmlDocument)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlDocument | xmlDocument | The owning XML document.  | 
      
Returns
| Type | Description | 
|---|---|
| XmlElement | The authentication request as XML.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML serialization fails.  |