Export (0) Print
Expand All

SecurityTokenHandler.GetTokenTypeIdentifiers Method

.NET Framework 4.5

When overridden in a derived class, returns the set of URIs that are used in requests to identify a token of the type processed by the derived class.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

abstract GetTokenTypeIdentifiers : unit -> string[] 

Return Value

Type: System.String[]
The set of URIs that identify the token type that this handler supports.

The Type of the token processed by the current instance is accessed through the TokenType property. The GetTokenTypeIdentifiers method returns the set of acceptable identifiers that can be used in messages to refer to the token type. For example, the URI value used in the <wst:TokenType> element under the <wst:RequestSecurityToken> element to request a specific kind of token (represented by the WSTrustMessage.TokenType property in the object model).

The following code shows how to override the GetTokenTypeIdentifiers method to return the token type identifiers for a custom token. The code is taken from the Custom Token sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). For information about this sample and other samples available for WIF and where to download them, see WIF Code Sample Index.

public const string SimpleWebTokenTypeUri = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0";


...


/// <summary> 
/// Returns the simple web token's token type that is supported by this handler. 
/// </summary>  
/// <returns>A list of supported token type identifiers.</returns> 
public override string[] GetTokenTypeIdentifiers()
{
    return new string[] { SimpleWebTokenTypeUri };
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft