편집

다음을 통해 공유


SecureConversationServiceCredential.SecurityContextClaimTypes Property

Definition

Gets a collection of the Type claims for cookie serialization.

public:
 property System::Collections::ObjectModel::Collection<Type ^> ^ SecurityContextClaimTypes { System::Collections::ObjectModel::Collection<Type ^> ^ get(); };
public System.Collections.ObjectModel.Collection<Type> SecurityContextClaimTypes { get; }
member this.SecurityContextClaimTypes : System.Collections.ObjectModel.Collection<Type>
Public ReadOnly Property SecurityContextClaimTypes As Collection(Of Type)

Property Value

A collection of the Type claims for cookie serialization.

Examples

The following code shows how to get this property.

static void Configure(ServiceHost serviceHost)
{
    /*
     * There are certain settings that cannot be configured via app.config.
     * The security state encoder is one of them.
     * Plug in a SecurityStateEncoder that uses the configured certificate
     * to protect the security context token state.
     *
     * Note: You don't need a security state encoder for cookie mode.  This was added to the
     * sample to illustrate how you would plug in a custom security state encoder should
     * your scenario require one.
     * */
    serviceHost.Credentials.SecureConversationAuthentication.SecurityStateEncoder =
            new CertificateSecurityStateEncoder(serviceHost.Credentials.ServiceCertificate.Certificate);
   Collection<Type> myClaimTypes = new Collection<Type>();
    myClaimTypes = serviceHost.Credentials.SecureConversationAuthentication.SecurityContextClaimTypes;
}

Remarks

To serialize claims into SCT cookies, Windows Communication Foundation (WCF) uses DataContractSerializer as the default. Because the Claim resource is extensible, WCF allows you to provide a list of known resource types. This assists the DataContractSerializer during deserialization of the claims in the cookie so that it can return the original strongly-typed objects.

Applies to