Breyta

Deila með


IssuedTokenServiceCredential.SamlSerializer Property

Definition

Gets or sets the custom SamlSerializer for issued service credentials.

public:
 property System::IdentityModel::Tokens::SamlSerializer ^ SamlSerializer { System::IdentityModel::Tokens::SamlSerializer ^ get(); void set(System::IdentityModel::Tokens::SamlSerializer ^ value); };
public System.IdentityModel.Tokens.SamlSerializer SamlSerializer { get; set; }
member this.SamlSerializer : System.IdentityModel.Tokens.SamlSerializer with get, set
Public Property SamlSerializer As SamlSerializer

Property Value

The custom SamlSerializer for the service.

Exceptions

Attempted to set a read-only credential.

Examples

The following code shows how to set this property.

ServiceCredentials creds = new ServiceCredentials();
creds.IssuedTokenAuthentication.SamlSerializer = new
    MySamSerializer();
Dim creds As New ServiceCredentials()
creds.IssuedTokenAuthentication.SamlSerializer = New MySamSerializer()

The property can also be set in a configuration file.

    <!-- </system.serviceModel -->
    <behaviors>
      <serviceBehaviors>
        <behavior name="CalculatorServiceBehavior">
          <serviceCredentials>
            <issuedTokenAuthentication samlSerializerType="Samples.CustomSamlSerializer, CustomSample" />
          </serviceCredentials>
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Remarks

The issued tokens that this class uses are SAML tokens. Windows Communication Foundation (WCF) provides a default class SamlSerializer that is able to serialize and deserialize the majority of SAML tokens. If the service must process SAML tokens that contain elements that are not supported by the default serializer, this property can be used to provide a custom serializer capable of processing these elements.

Applies to