Partage via


SecureConversationServiceCredential.SecurityContextClaimTypes Propriété

Définition

Obtient une collection des revendications Type pour la sérialisation de cookies.

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)

Valeur de propriété

Collection<Type>

Collection des revendications Type pour la sérialisation de cookies.

Exemples

Le code suivant montre comment obtenir cette propriété.

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;
}

Remarques

Pour sérialiser les revendications dans les cookies SCT, Windows Communication Foundation (WCF) utilise DataContractSerializer comme valeur par défaut. Étant donné que la ressource de revendication est extensible, WCF vous permet de fournir une liste de types de ressources connus. Cela aide DataContractSerializer pendant la désérialisation des revendications dans le cookie afin qu’il puisse retourner les objets fortement typés d’origine.

S’applique à