Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to secure a webservice in .net?

I have written a simple .NET webservice, which I will be hosted on a different server may be on different continent. I don't really know. Now, I only had its URL and I tried to use webrequest and webresponse method to access that web service vai HTTP POST. Now, I want to know is there any way to secure the webservice access, so that nobody can exploit it?

for example:

http://example.com/Verify/Verification.asmx/Verify?AccountNumber=3223&ProductName=876

Now, these are all the parameters required to call this webservice. As if now, anyone can exploit it. So how can I make it secure? Although, I am planning to get SSL and this whole thing is happening from server to server, not from client to server?

like image 727
Mohit Avatar asked May 06 '09 12:05

Mohit


People also ask

How do you provide security in .NET Web services?

NET offers the Web service developer two security options: rely on Windows security or provide custom security. You also need to disable anonymous access to the Web service. In IIS, display the properties of the Web service and select the Directory Security tab.

Can Web service be made secure?

Security is critical to web services. However, neither XML-RPC nor SOAP specifications make any explicit security or authentication requirements.

What kind of security is needed for Web services?

The key Web services security requirements are authentication, authorization, data protection, and nonrepudiation. Authentication ensures that each entity involved in using a Web service—the requestor, the provider, and the broker (if there is one)—is what it actually claims to be.


1 Answers

You can pass a service key (much like Amazon WS) in the authorization header of the web request which could be encrypted with an algorithm of your choice, which is then decrypted at the service end and only continue with the execution if the key matches

See section 14.8 in the following URL

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

like image 97
Nick Allen Avatar answered Sep 29 '22 12:09

Nick Allen