SecureConversationServiceCredential.SecurityContextClaimTypes Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection of the Type claims for cookie serialization.
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)
Property Value
A collection of the Type claims for cookie serialization.
Examples
The following code shows how to get this property.
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;
}
Remarks
To serialize claims into SCT cookies, Windows Communication Foundation (WCF) uses DataContractSerializer as the default. Because the Claim resource is extensible, WCF allows you to provide a list of known resource types. This assists the DataContractSerializer during deserialization of the claims in the cookie so that it can return the original strongly-typed objects.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應