Partilhar via


ClientCredentialsSecurityTokenManager Classe

Definição

Gerencia tokens de segurança para o cliente.

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
Herança
ClientCredentialsSecurityTokenManager
Derivado

Exemplos

O código a seguir mostra como você pode substituir essa classe para criar um Gerenciador de Tokens de Segurança de Credenciais de Cliente personalizado.

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

Comentários

Essa classe lida com serialização de token de segurança, provisionamento de token de segurança e autenticação de token de segurança para o cliente. Há uma instância dessa classe para cada fábrica de canais cliente.

Construtores

ClientCredentialsSecurityTokenManager(ClientCredentials)

Inicializa uma nova instância da classe ClientCredentialsSecurityTokenManager.

Propriedades

ClientCredentials

Obtém as credenciais do cliente.

Métodos

CreateSecurityTokenAuthenticator(SecurityTokenRequirement, SecurityTokenResolver)

Cria um autenticador de token de segurança.

CreateSecurityTokenProvider(SecurityTokenRequirement)

Cria um provedor de token de segurança.

CreateSecurityTokenSerializer(SecurityTokenVersion)

Cria um serializador de token de segurança.

CreateSecurityTokenSerializer(SecurityVersion)

Cria um serializador de token de segurança.

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)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
IsIssuedSecurityTokenRequirement(SecurityTokenRequirement)

Obtém um valor que indica se o requisito de token especificado é um requisito de token de segurança 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