SecurityToken.Id 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 unique identifier of the security token.
public:
abstract property System::String ^ Id { System::String ^ get(); };
public abstract string Id { get; }
member this.Id : string
Public MustOverride ReadOnly Property Id As String
Property Value
The unique identifier of the security token.
Examples
The code examples that are used in the SecurityToken topics are taken from the Custom Token
sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a SimpleWebToken
class and a SimpleWebTokenHandler
class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see WIF Code Sample Index. The following code shows the override of the Id property.
/// <summary>
/// Defines the set of constants for the Simple Web Token.
/// </summary>
public static class SimpleWebTokenConstants
{
public const string Audience = "Audience";
public const string ExpiresOn = "ExpiresOn";
public const string Id = "Id";
public const string Issuer = "Issuer";
public const string Signature = "HMACSHA256";
public const string ValidFrom = "ValidFrom";
public const string ValueTypeUri = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0";
}
public static DateTime SwtBaseTime = new DateTime( 1970, 1, 1, 0, 0, 0, 0 ); // per SWT psec
NameValueCollection _properties;
/// <summary>
/// Gets the Id of the token.
/// </summary>
/// <value>The Id of the token.</value>
public override string Id
{
get
{
return _properties[SimpleWebTokenConstants.Id];
}
}
Remarks
Typically, when a security token is serialized into XML, the Id
attribute for the security token is set to the value of the Id property.
Notes to Implementers
You must override the Id property.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기