SecureConversationServiceCredential.SecurityContextClaimTypes Eigenschaft

Definition

Ruft eine Auflistung der Type Ansprüche für die Cookie-Serialisierung 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

Eine Sammlung der Ansprüche für die Type Cookie-Serialisierung.

Beispiele

Der folgende Code zeigt, wie Sie diese Eigenschaft abrufen.

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 zu serialisieren, verwendet Windows Communication Foundation (WCF) DataContractSerializer als Standard. Da die Anspruchsressource erweiterbar ist, können Sie mit WCF eine Liste bekannter Ressourcentypen bereitstellen. Dadurch wird die DataContractSerializer Während der Deserialisierung der Ansprüche im Cookie unterstützt, sodass sie die ursprünglichen stark typisierten Objekte zurückgeben kann.

Gilt für: