Find out where a request to a WCF program is coming from?
I'm making a very simple WCF (C#, .NET 4.0) licensing program that automatically emails a user a key they can use to activate the software they just bought.
My idea is my website would call a function provided by my service which would generate a key and then send the key the email provided. Later my software would also call that service and use that key to register/activate the product. The function I has in mind looks something like:
void (String email, String ProductID)
Obviously I'd like to have some degree of authentication with that function - only my website should be able to ask the service to generate a key (and hopefully that happens after they've purchased the software.) Could I use the same method to provide the same functiona开发者_如何学Pythonlity based on Paypal IPN (I've never used it, but I've read you can have paypal IPN send you a ping once a user has paid for something)?
Please keep in mind I'm not trying to create a super secure system, I'm just trying to explore the concepts of licensing systems by building a working system. I was inspired by this post earlier today and making something similar seemed like a great way for me to finally learn WCF (I'm one of those people who can only really learn something by diving in.)
Thanks for your insights!
You can filter the requests in the config file using the
<behavior>
<IPFilter .. />
</behavior>
as described in the following post.
Can I setup an IP filter for a WCF Service?
If you want to do it with in the function, you can check the IP address as shown in the below link:
http://nayyeri.net/detect-client-ip-in-wcf-3-5
精彩评论