Język

SecureConversationServiceCredential.SecurityContextClaimTypes Właściwość

Definicja

Pobiera kolekcję Type oświadczeń na potrzeby serializacji plików 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)

Wartość właściwości

Kolekcja Type oświadczeń serializacji plików cookie.

Przykłady

Poniższy kod pokazuje, jak uzyskać tę właściwość.

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

Uwagi

Aby serializować oświadczenia w plikach cookie SCT, Windows Communication Foundation (WCF) używa DataContractSerializer jako domyślne. Ponieważ zasób oświadczenia jest rozszerzalny, program WCF umożliwia podanie listy znanych typów zasobów. DataContractSerializer Pomaga to podczas deserializacji oświadczeń w pliku cookie, dzięki czemu może zwrócić oryginalne obiekty silnie typizowane.

Dotyczy