SecurityTokenHandler.GetTokenTypeIdentifiers 方法

定义

当在派生类中重写时,将返回在请求中使用的 URI 集,以标识由该派生类处理的类型标记。

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

返回

String[]

识别该处理程序支持的标识种类 URIs 集合。

示例

以下代码演示如何重写 方法以 GetTokenTypeIdentifiers 返回自定义令牌的令牌类型标识符。 代码取自 Custom Token 示例。 此示例提供自定义类,这些类支持 (SWT) 处理简单 Web 令牌。 有关此示例和其他可用于 WIF 的示例以及下载位置的信息,请参阅 WIF 代码示例索引

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

注解

Type当前实例处理的令牌的 通过 TokenType 属性进行访问。 方法 GetTokenTypeIdentifiers 返回一组可接受的标识符,这些标识符可用于在消息中引用令牌类型。 例如,元素下的 <wst:TokenType><wst:RequestSecurityToken> 元素中用于请求特定类型的令牌的 URI 值 (对象模型中的 WSTrustMessage.TokenType 属性表示) 。

适用于