SecureConversationServiceCredential.SecurityContextClaimTypes Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar en samling anspråk för Type cookie-serialisering.
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)
Egenskapsvärde
En samling anspråk för Type cookie-serialisering.
Exempel
Följande kod visar hur du hämtar den här egenskapen.
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;
}
Kommentarer
För att serialisera anspråk till SCT-cookies använder Windows Communication Foundation (WCF) DataContractSerializer som standard. Eftersom anspråksresursen är utökningsbar kan du med WCF ange en lista över kända resurstyper. Detta hjälper DataContractSerializer under deserialiseringen av anspråken i cookien så att den kan returnera de ursprungliga starkt typerade objekten.