MessageSecurityOverHttp.NegotiateServiceCredential Propriedade

Definição

Obtém ou define um valor que indica se a credencial de serviço é provisionada no cliente fora de banda ou é obtida no serviço por meio de um processo de negociação.Gets or sets a value that indicates whether the service credential is provisioned at the client out of band or is obtained from the service through a process of negotiation.

public:
 property bool NegotiateServiceCredential { bool get(); void set(bool value); };
public bool NegotiateServiceCredential { get; set; }
member this.NegotiateServiceCredential : bool with get, set
Public Property NegotiateServiceCredential As Boolean

Valor da propriedade

Boolean

true se a credencial de serviço for obtida por meio de um processo de negociação; caso contrário, false.true if service credential is obtained through a process of negotiation; otherwise, false. O padrão é true.The default is true.

Exemplos

O código a seguir mostra como acessar e definir essa propriedade.The following code shows how to access and set this property.

WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
    MessageCredentialType.UserName;
binding.Security.Message.NegotiateServiceCredential = false;

CalculatorClient CalculatorClient = new CalculatorClient("myBinding");
CalculatorClient.ClientCredentials.ServiceCertificate.
    SetDefaultCertificate("Al", StoreLocation.CurrentUser, StoreName.My);
Dim binding As New WSHttpBinding()
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.ClientCredentialType = _
MessageCredentialType.UserName
binding.Security.Message.NegotiateServiceCredential = False

Dim CalculatorClient As New CalculatorClient("myBinding")
CalculatorClient.ClientCredentials.ServiceCertificate. _
    SetDefaultCertificate("Al", StoreLocation.CurrentUser, StoreName.My)

Comentários

Definir essa propriedade como true , requer que WS-Trust e WS-SecureConversation sejam suportados pelo cliente e pelo serviço.Setting this property to true, requires WS-Trust and WS-SecureConversation to be supported by the client and the service. A definição dessa propriedade como não false requer WS-Trust ou WS-SecureConversation ter suporte.Setting this property to false does not require WS-Trust or WS-SecureConversation to be supported.

Para tipos de credencial de cliente anônimos, de nome de usuário ou certificado, definir essa propriedade como false implica que o certificado de serviço deve estar disponível no cliente fora de banda e que o cliente deve especificar o certificado do serviço a ser usado.For Anonymous, Username or Certificate client credential types, setting this property to false implies that the service certificate must be available at the client out of band and that the client must specify the service's certificate to use.

No caso de credenciais do Windows, definir essa propriedade como false causa uma autenticação baseada em KerberosToken .In the case of Windows credentials, setting this property to false causes an authentication based on KerberosToken. Isso requer que o cliente e o serviço façam parte de um domínio Kerberos.This requires that the client and service be part of a Kerberos domain. Esse modo é interoperável com pilhas SOAP que implementam o perfil de token Kerberos do OASIS.This mode is interoperable with SOAP stacks that implement the Kerberos token profile from OASIS. Definir essa propriedade como true faz com que uma negociação SOAP que encapsula o intercâmbio de mensagens de SOAP em SPNEGO.Setting this property to true causes a SOAP negotiation that tunnels SPNego exchange over SOAP messages. Esse modo não é interoperável.This mode is not interoperable.

Essa propriedade indica se a credencial de serviço é negociada automaticamente entre o cliente e o serviço.This property indicates whether the service credential is negotiated automatically between the client and the service. Se essa propriedade for true , essa negociação ocorrerá.If this property is true, then such negotiation occurs. Se essa propriedade for false , as credenciais de serviço deverão ser especificadas no cliente antes que a comunicação com o serviço possa ocorrer.If this property is false, then the service credentials must be specified at the client before communication with the service can occur.

Se essa propriedade for definida como false e a associação estiver configurada para usar o Windows como um tipo de credencial de cliente, a conta de serviço deverá ser associada a um SPN (nome da entidade de serviço).If this property is set to false, and the binding is configured to use Windows as a client credential type, the service account must be associated with a Service Principal Name (SPN). Para fazer isso, execute o serviço na conta de serviço de rede ou na conta sistema LOCAL.To do this, run the service under the NETWORK SERVICE account, or LOCAL SYSTEM account. Como alternativa, use a ferramenta SetSpn.exe para criar um SPN para a conta de serviço.Alternatively, use the SetSpn.exe tool to create an SPN for the service account. Em ambos os casos, o cliente deve usar o SPN correto no elemento < servicePrincipalName > ou usando o EndpointAddress Construtor.In either case, the client must use the correct SPN in the <servicePrincipalName> element, or by using the EndpointAddress constructor. Para obter mais informações, consulte identidade de serviço e autenticação.For more information, see Service Identity and Authentication.

Aplica-se a