tags:

views:

601

answers:

1

Hi,

There is a requirement to test a WCF RESTful webservice. The server uses a trusted certificate based authentication. For writing unit test cases to test web methods, how to go about for the authentication, is it necessary to pass the certificate information for each http request as the session is stateless in the rest web service, or how to test the authentication part.

Thank you in Advance,

A: 

You should be able to make self-signed certificates, then configure the test server to accept those for test purposes. If you go this route, you might consider adding a testing flag to disable those certificates, in case they somehow accidentally get deployed.

However, WCF authentication is quite flexible, so it should not be hard to switch over to other forms, such a user/pass.

Finally, if you are using Active Directory, you can enable the AD Certificate Mapper, and attach certificates to user accounts. The application will see the authentication as Windows authentication -- the certificate part becomes transparent. This allows you to simple reconfigure AD, or switch to, say, NTLM, without reconfiguring your application.

If you post more info on your setup, you might get better answers.

MichaelGG
Thanks for the info, setup is still not available, the ask is to test he service end point and that it is not prone to any security attacks. The site is going to use http and available over the internet, hence user/pass will not be secure, as well as AD.