SecurityTokenAuthenticator 类

定义

对安全令牌进行身份验证。Authenticates a security token.

public ref class SecurityTokenAuthenticator abstract
public abstract class SecurityTokenAuthenticator
type SecurityTokenAuthenticator = class
Public MustInherit Class SecurityTokenAuthenticator
继承
SecurityTokenAuthenticator
派生

注解

SecurityTokenAuthenticator 类以及从中派生的类对安全令牌进行身份验证。The SecurityTokenAuthenticator class and the classes that derive from it authenticate security tokens. 通常,只有在创建自定义安全令牌时,才应从 SecurityTokenAuthenticator 中直接派生类。Typically, you would only derive a class directly from SecurityTokenAuthenticator when you create a custom security token. 如果要重写内置安全令牌的默认身份验证或授权行为,请从派生自 SecurityTokenAuthenticator 的某个类(如 SamlSecurityTokenAuthenticator)中进行派生。If you wanted to override the default authentication or authorization behaviors for built-in security tokens, derive from one of the classes that derive from SecurityTokenAuthenticator, such as SamlSecurityTokenAuthenticator.

SecurityTokenAuthenticator 中派生类时,应重写下面的两个方法:ValidateTokenCoreCanValidateTokenCoreWhen you derive a class from SecurityTokenAuthenticator, override the following two methods: ValidateTokenCore and CanValidateTokenCore. CanValidateTokenCore 方法确定此安全令牌身份验证器是否可以对特定安全令牌进行身份验证。The CanValidateTokenCore method determines whether this security token authenticator can authenticate a specific security token. ValidateTokenCore 方法对安全令牌进行身份验证,并建立一组授权策略以进行授权。The ValidateTokenCore method authenticates the security token and establishes a set of authorization policies for authorization. 授权策略将位于安全令牌中的声明映射到应用程序所需的声明。The authorization policies map the claims found in the security token to claims required by the application.

构造函数

SecurityTokenAuthenticator()

初始化 SecurityTokenAuthenticator 类的新实例。Initializes a new instance of the SecurityTokenAuthenticator class.

方法

CanValidateToken(SecurityToken)

获取一个值,该值指示指定的安全令牌是否可由该安全令牌身份验证器进行验证。Gets a value indicating whether the specified security token can be validated by this security token authenticator.

CanValidateTokenCore(SecurityToken)

在派生类中重写时,获取一个值,指示此安全令牌身份验证器是否可以验证指定的安全令牌。When overridden in a derived class, gets a value indicating whether the specified security token can be validated by this security token authenticator.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
ValidateToken(SecurityToken)

对指定的安全令牌进行身份验证,并返回该安全令牌的授权策略集。Authenticates the specified security token and returns the set of authorization policies for the security token.

ValidateTokenCore(SecurityToken)

在派生类中重写时,对指定的安全令牌进行身份验证,并返回该安全令牌的授权策略集。When overridden in a derived class, authenticates the specified security token and returns the set of authorization policies for the security token.

适用于

另请参阅