Compartilhar via


ServiceCredentialsSecurityTokenManager Classe

Definição

Representa uma implementação de SecurityTokenManager que fornece serializadores de token de segurança com base no ServiceCredentials configurado no serviço.

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
Herança
ServiceCredentialsSecurityTokenManager
Implementações

Exemplos

O código a seguir mostra como substituir essa classe para criar um Gerenciador de Tokens de Credenciais de Serviço personalizado.

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

Comentários

Essa classe cria instâncias da SecurityTokenSerializer classe. Há uma instância dessa classe para cada ouvinte de canal de serviço.

Construtores

ServiceCredentialsSecurityTokenManager(ServiceCredentials)

Inicializa uma nova instância da classe ServiceCredentialsSecurityTokenManager com base no ServiceCredentials passado.

Propriedades

ServiceCredentials

Obtém as credenciais de serviço usadas para construir essa instância dessa classe.

Métodos

CreateSecureConversationTokenAuthenticator(RecipientServiceModelSecurityTokenRequirement, Boolean, SecurityTokenResolver)

Cria um autenticador de token de conversa seguro de acordo com os requisitos de propriedade passados.

CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver)

Cria um autenticador de token de segurança com base em SecurityTokenRequirement.

CreateSecurityTokenProvider(SecurityTokenRequirement)

Cria um provedor de token de segurança com base em SecurityTokenRequirement.

CreateSecurityTokenSerializer(SecurityTokenVersion)

Cria um serializador de token de segurança com base na versão do token de segurança passada.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.

(Herdado de Object)
GetIdentityOfSelf(SecurityTokenRequirement)

Obtém o EndpointIdentity com base no requisito de token de segurança.

GetType()

Obtém o Type da instância atual.

(Herdado de Object)
IsIssuedSecurityTokenRequirement(SecurityTokenRequirement)

Determina se o requisito de token de segurança é para um token emitido.

MemberwiseClone()

Cria uma cópia superficial do Object atual.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)

Aplica-se a