SecurityTokenManager.CreateSecurityTokenSerializer Method
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 an XML serializer that can serialize security tokens in the specified version of the WS-* specifications.
public:
abstract System::IdentityModel::Selectors::SecurityTokenSerializer ^ CreateSecurityTokenSerializer(System::IdentityModel::Selectors::SecurityTokenVersion ^ version);
public abstract System.IdentityModel.Selectors.SecurityTokenSerializer CreateSecurityTokenSerializer (System.IdentityModel.Selectors.SecurityTokenVersion version);
abstract member CreateSecurityTokenSerializer : System.IdentityModel.Selectors.SecurityTokenVersion -> System.IdentityModel.Selectors.SecurityTokenSerializer
Public MustOverride Function CreateSecurityTokenSerializer (version As SecurityTokenVersion) As SecurityTokenSerializer
Parameters
- version
- SecurityTokenVersion
A SecurityTokenVersion that specifies the WS-* specification versions that security tokens adhere to.
Returns
A SecurityTokenSerializer to serialize the security tokens.
Remarks
To add serialization support for a custom token, derive a class from WSSecurityTokenSerializer and return an instance of that class for the CreateSecurityTokenSerializer(SecurityTokenVersion) method. The WSSecurityTokenSerializer class, which derives from the SecurityTokenSerializer class, is capable of serializing and deserializing the security tokens that ship with WCF. Thus, to add support for a custom token to the serializer, override the virtual methods in the WSSecurityTokenSerializer class, add code that checks whether the desired security token is the custom token, and, if not, call the base class method.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應