ServiceCredentialsSecurityTokenManager 类

定义

表示 SecurityTokenManager 实现,可基于在服务上配置的 ServiceCredentials 提供安全令牌序列化程序。

public ref class ServiceCredentialsSecurityTokenManager : System::IdentityModel::Selectors::SecurityTokenManager, System::ServiceModel::Security::IEndpointIdentityProvider
public class ServiceCredentialsSecurityTokenManager : System.IdentityModel.Selectors.SecurityTokenManager, System.ServiceModel.Security.IEndpointIdentityProvider
type ServiceCredentialsSecurityTokenManager = class
    inherit SecurityTokenManager
    interface IEndpointIdentityProvider
Public Class ServiceCredentialsSecurityTokenManager
Inherits SecurityTokenManager
Implements IEndpointIdentityProvider
继承
ServiceCredentialsSecurityTokenManager
实现

示例

下面的代码演示如何重写此类,以创建自定义的服务凭据令牌管理器。

internal class MyServiceCredentialsSecurityTokenManager :
    ServiceCredentialsSecurityTokenManager
{
    MyServiceCredentials credentials;

    public MyServiceCredentialsSecurityTokenManager(MyServiceCredentials credentials)
        : base(credentials)
    {
        this.credentials = credentials;
    }

    public override SecurityTokenProvider CreateSecurityTokenProvider(SecurityTokenRequirement tokenRequirement)
    {
        // Return your implementation of 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 SecurityTokenProvider, 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 SecurityTokenProvider, if required.
        // This implementation delegates to the base class.
        return base.CreateSecurityTokenSerializer(version);
    }
}
Friend Class MyServiceCredentialsSecurityTokenManager
    Inherits ServiceCredentialsSecurityTokenManager
    Private credentials As MyServiceCredentials

    Public Sub New(ByVal credentials As MyServiceCredentials) 
        MyBase.New(credentials)
        Me.credentials = credentials
    
    End Sub
    
    
    Public Overrides Function CreateSecurityTokenProvider(ByVal tokenRequirement As SecurityTokenRequirement) _
    As SecurityTokenProvider
        ' Return your implementation of 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 SecurityTokenProvider, 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 SecurityTokenProvider, if required.
        ' This implementation delegates to the base class.
        Return MyBase.CreateSecurityTokenSerializer(version)

    End Function
End Class

注解

此类创建 SecurityTokenSerializer 类的实例。 每个服务通道侦听器都有一个此类的实例。

构造函数

ServiceCredentialsSecurityTokenManager(ServiceCredentials)

基于传入的 ServiceCredentialsSecurityTokenManager 初始化 ServiceCredentials 类的新实例。

属性

ServiceCredentials

获取用于构造此类实例的服务凭据。

方法

CreateSecureConversationTokenAuthenticator(RecipientServiceModelSecurityTokenRequirement, Boolean, SecurityTokenResolver)

基于传入的属性要求创建安全对话令牌身份验证器。

CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver)

基于 SecurityTokenRequirement 创建安全令牌身份验证器。

CreateSecurityTokenProvider(SecurityTokenRequirement)

基于 SecurityTokenRequirement 创建安全令牌提供程序。

CreateSecurityTokenSerializer(SecurityTokenVersion)

基于传入的安全令牌版本创建安全令牌序列化程序。

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetIdentityOfSelf(SecurityTokenRequirement)

基于安全令牌需求获取 EndpointIdentity

GetType()

获取当前实例的 Type

(继承自 Object)
IsIssuedSecurityTokenRequirement(SecurityTokenRequirement)

确定安全令牌需求是否适用于已颁发的令牌。

MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于