ServiceSecurityContext.PrimaryIdentity Propriedade
Definição
Obtém a identidade primária associada à configuração atual.Gets the primary identity associated with the current setting.
public:
property System::Security::Principal::IIdentity ^ PrimaryIdentity { System::Security::Principal::IIdentity ^ get(); };
public System.Security.Principal.IIdentity PrimaryIdentity { get; }
member this.PrimaryIdentity : System.Security.Principal.IIdentity
Public ReadOnly Property PrimaryIdentity As IIdentity
Valor da propriedade
Um IIdentity associado à configuração atual.An IIdentity associated with the current setting.
Exemplos
Para obter um exemplo de como usar a PrimaryIdentity propriedade para autorizar um cliente usando um certificado, consulte como examinar o contexto de segurança.For an example of using the PrimaryIdentity property to authorize a client using a certificate, see How to: Examine the Security Context.
Comentários
A identidade primária é obtida das credenciais usadas para autenticar o usuário atual.The primary identity is obtained from the credentials used to authenticate the current user. Se a credencial for um certificado X. 509, a identidade será uma concatenação do nome da entidade e da impressão digital (nessa ordem).If the credential is an X.509 certificate, the identity is a concatenation of the subject name and the thumbprint (in that order). O nome da entidade é separado da impressão digital com um ponto e vírgula e um espaço.The subject name is separated from the thumbprint with a semicolon and a space. Se o campo assunto do certificado for null , a identidade primária incluirá apenas um ponto-e-vírgula, um espaço e a impressão digital.If the subject field of the certificate is null, the primary identity includes just a semicolon, a space, and the thumbprint.
Quando um padrão de troca de mensagens duplex é usado com a autenticação direta Kerberos, essa propriedade torna-se vazia no retorno de chamada e o ClaimSet também está vazio.When a duplex message exchange pattern is used with Kerberos direct authentication, this property becomes empty on the callback and the claimset is also empty. Isso não acontece quando SspiNegotiated é usado em vez de Kerberos.This does not happen when SspiNegotiated is used instead of Kerberos.
O token do solicitante Kerberos é usado somente no cliente para representar o serviço.The Kerberos Requester Token is used only on the client to represent the service. A política de autorização que ele gera contém uma declaração, um SPN; Portanto, nenhuma identidade na declaração.The authorization policy that it generates contains one claim, an SPN; hence, no identity in the claim. Na maioria dos casos, não há problema, porque ServiceSecurityContext não é usado no cliente.In most cases there is no problem, because ServiceSecurityContext is not used on the client. Em um cenário duplex durante o retorno de chamada, se o retorno de chamada inspecionar essa propriedade, ela receberá uma identidade anônima.In a duplex scenario during callback, if the callback inspects this property, it gets an anonymous identity.