共用方式為


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 類別的執行個體。 每個服務通道接聽程式 (Listener) 各有一個這個類別的執行個體。

建構函式

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)

適用於