Redigera

Dela via


SecurityTokenHandler.GetTokenTypeIdentifiers Method

Definition

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.

public:
 abstract cli::array <System::String ^> ^ GetTokenTypeIdentifiers();
public abstract string[] GetTokenTypeIdentifiers ();
abstract member GetTokenTypeIdentifiers : unit -> string[]
Public MustOverride Function GetTokenTypeIdentifiers () As String()

Returns

String[]

The set of URIs that identify the token type that this handler supports.

Examples

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 };
}

Remarks

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).

Applies to