none
Accessing clientcertificate.Subject from within a WCF web service method. RRS feed

  • Question

  • In asp.net, I can access the clientcertificate.subject from the Request object.

    Dim thisSubject as string = request.clientcertificate.subject

    Is there a way I can access the clientcerticate.subject from within a method of a WCF Web service?

    Friday, July 26, 2013 5:24 PM

Answers

  • I found the solution:

    ServiceSecurityContext.Current.PrimaryIdentity.Name has the certificate's subject concantenated with a semicolon, a space, and the certificate's thumbprint.

    This is a very easy way to determine the identity of the client.

    Saturday, July 27, 2013 2:02 PM

All replies

  • I found the solution:

    ServiceSecurityContext.Current.PrimaryIdentity.Name has the certificate's subject concantenated with a semicolon, a space, and the certificate's thumbprint.

    This is a very easy way to determine the identity of the client.

    Saturday, July 27, 2013 2:02 PM
  • Hi,

    I am very glad that you have solved your problem by yourself. And it will help the others who meet the same question as you.

    If you have any other problem, welcome to post it in the wcf forums.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Monday, July 29, 2013 3:26 AM
    Moderator