SecureConversationServiceCredential.SecurityContextClaimTypes Vlastnost

Definice

Získá kolekci Type deklarací identity pro serializaci souborů cookie.

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)

Hodnota vlastnosti

Collection<Type>

Kolekce Type deklarací identity pro serializaci souborů cookie.

Příklady

Následující kód ukazuje, jak získat tuto vlastnost.

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

Poznámky

K serializaci deklarací identity do souborů cookie SCT používá DataContractSerializer Windows Communication Foundation (WCF) jako výchozí. Vzhledem k tomu, že je prostředek deklarace identity rozšiřitelný, umožňuje WCF poskytnout seznam známých typů prostředků. To pomáhá DataContractSerializer při deserializaci deklarací deklarací v souboru cookie, aby mohl vrátit původní objekty se silnými typy.

Platí pro