SecurityTokenHandler.GetTokenTypeIdentifiers Method ()

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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 = "";
/// <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
Available since 4.5
Return to top