Freigeben über


SecureConversationServiceCredential.SecurityContextClaimTypes Eigenschaft

Definition

Ruft eine Auflistung der Type-Ansprüche für die Cookieserialisierung ab.

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)

Eigenschaftswert

Collection<Type>

Eine Auflistung der Type-Ansprüche für die Cookieserialisierung.

Beispiele

Der folgende Code zeigt, wie diese Eigenschaft abgerufen wird.

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

Hinweise

Um Ansprüche in SCT-Cookies serialisieren zu können, wird Windows Communication Foundation (WCF) als Standard verwendetDataContractSerializer. Da die Anspruchsressource erweiterbar ist, ermöglicht WCF Es Ihnen, eine Liste bekannter Ressourcentypen bereitzustellen. Dadurch wird der DataContractSerializer während der Deserialisierung der Ansprüche im Cookie unterstützt, sodass die ursprünglichen stark typisierten Objekte zurückgegeben werden können.

Gilt für