SecureConversationServiceCredential.SecurityContextClaimTypes Eigenschap

Definitie

Hiermee haalt u een verzameling van de Type claims voor cookieserialisatie op.

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)

Waarde van eigenschap

Een verzameling van de Type claims voor cookieserialisatie.

Voorbeelden

De volgende code laat zien hoe u deze eigenschap kunt ophalen.

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

Opmerkingen

Voor het serialiseren van claims in SCT-cookies gebruikt Windows Communication Foundation (WCF) DataContractSerializer als standaardinstelling. Omdat de claimresource uitbreidbaar is, kunt u met WCF een lijst met bekende resourcetypen opgeven. Dit helpt de DataContractSerializer tijdens de deserialisatie van de claims in de cookie, zodat deze de oorspronkelijke sterk getypte objecten kan retourneren.

Van toepassing op