Last post May 23, 2012 09:10 AM by kidshaw
May 23, 2012 06:09 AM|Aronkumar|LINK
Im developing an .net application (silverlight 4) and i have used a asmx web service inside .net application. In order to secure my web service i have to restrict my web service to access publicly(while browsing directly) and allow to access my web
service within .net application only. Is there any way to secure like that. hardly in need of help.
Thanks & Regards,
May 23, 2012 07:13 AM|Mudasir.Khan|LINK
a simple solution is have a encrytion key pass to server by parameter inside every method call a common function which will return true false depending on the decryt the key check if matches the with some value, and if common method returns true then continue
going furthur else throw an exception
May 23, 2012 07:30 AM|Aronkumar|LINK
Thanks fo your reply.
We already tried the one with cryptography concept which u mentioned. But our criteria is, when we are accessing the url in web browser separately [i.e., by giving
http://18.104.22.168/Service1.asmx on browser]. it should not display what are all the web methods available inside the web service Service1.asmx. And the same web methods from Service1.asmx should get accessible
inside .Net application when we add that service as web reference. Is it possible to restrict the web service the way which we asked?
May 23, 2012 08:59 AM|karthicks|LINK
hi, after adding service references to your project. you can disable the wsdl , so that others can't see the details of the service.
to disable refer : http://forums.asp.net/t/1185735.aspx/1
May 23, 2012 09:10 AM|kidshaw|LINK
You should be able to set up authentication in IIS, then pass the credentials. You can control permissions at an item level, or move your services to a seperate virtual directory.
Take a look here -
http://msdn.microsoft.com/en-us/library/ms734769, might give you some ideas