Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear frds,

I want secure my web service, so only authorize user can take refrence, and internal user who having internal domain also can able to take reference of the web services,

Please tell me mechanism for authenticate them.

Thanks in advanced.
Posted
Comments
ZurdoDev 16-Mar-12 14:07pm    
Is it a WCF service? Much of it can be done in the config file. Need more info though.
Sergey Alexandrovich Kryukov 16-Mar-12 14:35pm    
If does not really matter. Please see my answer.
--SA
ZurdoDev 16-Mar-12 14:50pm    
It does matter. Your answer is all about certificates. It sounds like the OP is asking about security, not certificates. Certificates is one way to have security but you can also just write code or do a number of other ways. You need to know more than what OP stated to give an answer.
Sergey Alexandrovich Kryukov 16-Mar-12 23:54pm    
Maybe. Anyway, I can see your point. I mentioned only what I think are the key things of security. I did not mean WCF or not is not important. Of course it does matter, but on what level of detail? I just think that going into specifics of different kinds of services would need to answer on such level of detail that could go beyond the format of Quick Questions & Answers.

Anyway, if OP clarifies, are you going to provide more substantial answer? I would be interested to read it.

Thank you for your note,
--SA

1 solution

There are two components to achieve this: 1) authenticated access, 2) using HTTPS, not HTTP, at list for authentication, so no one could spy on the authentication-related traffic and later mimic the legitimate user.

Please see:
http://en.wikipedia.org/wiki/HTTPS[^].

The use of HTTPS is based on public-key cryptography and the system of certificate authorities.
Please see:
http://en.wikipedia.org/wiki/Public-key_cryptography[^],
http://en.wikipedia.org/wiki/Public_key_certificate[^],
http://en.wikipedia.org/wiki/Certificate_authority[^].

You should understand that the certificate check up has nothing to do with encryption itself. This is just a reliable way for a client side to check up that the Web service is legitimate, and not some malicious site trying to represent itself as a genuine one. The digital signature is something directly opposite to the decryption using a private key: the encryption key is uses as private, the decryption as public, that is, anyone can read the content of the certificate, no one can modify it or create an new certificate which could pass the check.

Ultimately, everything comes to using a service from some well-known and trusted certificate authority. You will need to pay fee for such service, for registration and support, per time of the usage. Alternatively, you can create and use self-signed certificate. In this case, the user should volunteer to accept such certificate. Imagine that you pass a certificate to some person hand to hand and say: "This certificate is self-signed. I'm giving you a copy of it on this flash drive (or I sent to via e-mail, if you choose to trust this e-mail). You can trust that this is my original certificate. Please install in on your system, then my code will trust it". In the client code, there is always an option to ignore certificate check up, but it's up to you to estimate the risk. For example, it can be quite acceptable if used insider some company…

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900