ClientCredentialsSecurityTokenManager ClientCredentialsSecurityTokenManager ClientCredentialsSecurityTokenManager ClientCredentialsSecurityTokenManager Class

定义

管理客户端的安全令牌。Manages security tokens for the client.

public ref class ClientCredentialsSecurityTokenManager : System::IdentityModel::Selectors::SecurityTokenManager
public class ClientCredentialsSecurityTokenManager : System.IdentityModel.Selectors.SecurityTokenManager
type ClientCredentialsSecurityTokenManager = class
    inherit SecurityTokenManager
Public Class ClientCredentialsSecurityTokenManager
Inherits SecurityTokenManager
继承
ClientCredentialsSecurityTokenManagerClientCredentialsSecurityTokenManagerClientCredentialsSecurityTokenManagerClientCredentialsSecurityTokenManager

示例

下面的代码演示如何重写此类,以创建一个自定义客户端凭据安全令牌管理器。The following code shows how you can override this class to create a custom Client Credentials Security Token Manager.

internal class MyClientCredentialsSecurityTokenManager : 
    ClientCredentialsSecurityTokenManager
{
    MyClientCredentials credentials;

    public MyClientCredentialsSecurityTokenManager(MyClientCredentials credentials)
        : base(credentials)
    {
        this.credentials = credentials;
    }

    public override SecurityTokenProvider CreateSecurityTokenProvider(
        SecurityTokenRequirement tokenRequirement)
    {
        // Return your implementation of the SecurityTokenProvider, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenProvider(tokenRequirement);
    }

    public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator(
        SecurityTokenRequirement tokenRequirement, out SecurityTokenResolver outOfBandTokenResolver)
    {
        // Return your implementation of the SecurityTokenAuthenticator, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenAuthenticator(tokenRequirement, out outOfBandTokenResolver);
    }

    public override SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityTokenVersion version)
    {
        // Return your implementation of the SecurityTokenSerializer, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenSerializer(version);
    }
}

Friend Class MyClientCredentialsSecurityTokenManager
    Inherits ClientCredentialsSecurityTokenManager
    Private credentials As MyClientCredentials
    
    
    Public Sub New(ByVal credentials As MyClientCredentials) 
        MyBase.New(credentials)
        Me.credentials = credentials
    
    End Sub
    
    
    Public Overrides Function CreateSecurityTokenProvider( _
    ByVal tokenRequirement As SecurityTokenRequirement) As SecurityTokenProvider
        ' Return your implementation of the SecurityTokenProvider, if required.
        ' This implementation delegates to the base class.
        Return MyBase.CreateSecurityTokenProvider(tokenRequirement)

    End Function
    
    
    Public Overrides Function CreateSecurityTokenAuthenticator( _
    ByVal tokenRequirement As SecurityTokenRequirement, _
    ByRef outOfBandTokenResolver As SecurityTokenResolver) As SecurityTokenAuthenticator
        ' Return your implementation of the SecurityTokenAuthenticator, if required.
        ' This implementation delegates to the base class.
        Return MyBase.CreateSecurityTokenAuthenticator(tokenRequirement, outOfBandTokenResolver)

    End Function
    
    
    Public Overrides Function CreateSecurityTokenSerializer(ByVal version As SecurityTokenVersion) _
    As SecurityTokenSerializer
        ' Return your implementation of the SecurityTokenSerializer, if required.
        ' This implementation delegates to the base class.
        Return MyBase.CreateSecurityTokenSerializer(version)

    End Function
End Class

注解

此类为客户端处理安全令牌序列化、安全令牌设置以及安全令牌身份验证等操作。This class handles security token serialization, security token provision and security token authentication for the client. 每个客户端信道工厂都有一个此类的实例。There is one instance of this class for each client channel factory.

构造函数

ClientCredentialsSecurityTokenManager(ClientCredentials) ClientCredentialsSecurityTokenManager(ClientCredentials) ClientCredentialsSecurityTokenManager(ClientCredentials) ClientCredentialsSecurityTokenManager(ClientCredentials)

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

属性

ClientCredentials ClientCredentials ClientCredentials ClientCredentials

获取客户端凭据。Gets the client credentials.

方法

CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver) CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver) CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver) CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver)

创建安全令牌身份验证器。Creates a security token authenticator.

CreateSecurityTokenProvider(SecurityTokenRequirement) CreateSecurityTokenProvider(SecurityTokenRequirement) CreateSecurityTokenProvider(SecurityTokenRequirement) CreateSecurityTokenProvider(SecurityTokenRequirement)

创建安全令牌提供程序。Creates a security token provider.

CreateSecurityTokenSerializer(SecurityTokenVersion) CreateSecurityTokenSerializer(SecurityTokenVersion) CreateSecurityTokenSerializer(SecurityTokenVersion) CreateSecurityTokenSerializer(SecurityTokenVersion)

创建安全令牌序列化程序。Creates a security token serializer.

CreateSecurityTokenSerializer(SecurityVersion) CreateSecurityTokenSerializer(SecurityVersion) CreateSecurityTokenSerializer(SecurityVersion) CreateSecurityTokenSerializer(SecurityVersion)

创建安全令牌序列化程序。Creates a security token serializer.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
IsIssuedSecurityTokenRequirement(SecurityTokenRequirement) IsIssuedSecurityTokenRequirement(SecurityTokenRequirement) IsIssuedSecurityTokenRequirement(SecurityTokenRequirement) IsIssuedSecurityTokenRequirement(SecurityTokenRequirement)

获取一个值,该值指示指定的令牌需求是否是已颁发的安全令牌需求。Gets a value that indicates whether the specified token requirement is an issued security token requirement.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

适用于