Home All Groups Group Topic Archive Search About

Client Certifcate Info in Web Service

Author
27 Jul 2006 7:21 PM
DaveR
How Do I go about accessing the Client Certifcate info in .NET for a web
service? All I can seem to find for an object containing this info is:

HttpClientCertificate cert = Request.ClientCertificate;

however, Request is not found...i'm guessing this is for an ASP.NET app vs
an ASP.NET Web Service.

Just need to verify the user so I can grant a limited access to the system
so they can't access/alter another companys info. Thanks.

Author
27 Jul 2006 7:34 PM
Joe Kaplan (MVP - ADSI)
You should be able to do HttpContext.Current.Request in your web service.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"DaveR" <Da***@discussions.microsoft.com> wrote in message
news:B92F369D-903B-4B9E-A668-992AEC56391A@microsoft.com...
> How Do I go about accessing the Client Certifcate info in .NET for a web
> service? All I can seem to find for an object containing this info is:
>
> HttpClientCertificate cert = Request.ClientCertificate;
>
> however, Request is not found...i'm guessing this is for an ASP.NET app vs
> an ASP.NET Web Service.
>
> Just need to verify the user so I can grant a limited access to the system
> so they can't access/alter another companys info. Thanks.
Author
27 Jul 2006 7:39 PM
Dominick Baier
Hi,

the Request is part of the current HttpContext.

get a reference to that first:

HttpContext ctx = HttpContext.Current;

HttpClientCertificate cert = ctx.Request.ClientCertificate;

I also did a screencast recently about this very topic - maybe thats interesting
to you:

http://go.microsoft.com/?linkid=5151512

dominick

Show quoteHide quote
> How Do I go about accessing the Client Certifcate info in .NET for a
> web service? All I can seem to find for an object containing this info
> is:
>
> HttpClientCertificate cert = Request.ClientCertificate;
>
> however, Request is not found...i'm guessing this is for an ASP.NET
> app vs an ASP.NET Web Service.
>
> Just need to verify the user so I can grant a limited access to the
> system so they can't access/alter another companys info. Thanks.
>