2009-12-14 14 views

Répondre

1

Dans votre code d'opération, vous pouvez examiner des choses comme:

OperationContext.Current 

ou

ServiceSecurityContext.Current 

mais je ne sais pas si vous pouvez accéder au certificat client réel de ceux-ci.

Le ServiceSecurityContext.Current.PrimaryIdentity contiendra un IIdentity pour l'appelant actuel - s'il est NULL, vous avez un appel anonyme. Sinon, le PrimaryIdentity sera l'un des types d'identité possibles, en fonction de la façon dont l'utilisateur appelant a été authentifié - il pourrait s'agir d'une identité Windows, ou autre chose - en fonction de votre scénario.

Voir ce blog post pour un peu plus d'informations sur X.509 et WCF.