如何限制对启用 silverlight 的数据服务的访问?
我们编写了一个 Silverlight 应用程序,它调用支持 Silverlight 的数据服务。 Silverlight 应用程序不需要登录,因为它需要向未经身份验证的公众提供数据。
我们有一些笨蛋花时间检查我们的 Silverlight 应用程序,以某种方式弄清楚它正在调用什么服务,然后编写自己的客户端来获取数据,以便他可以将其发布到他的网站上并假装它是他的。我们需要防止这种情况发生。
如何以某种方式限制我的数据服务仅接受来自我的 silverlight 应用程序的请求?我尝试使用 clientaccesspolicy.xml 文件中的 allow-from domain uri 设置来限制仅从 silverlight 应用程序所在的域(例如 mydomain.com)访问该服务。但这绝对没有任何作用,并且该服务仍在向域外的客户端提供请求。 (我通过将我的 SL 应用程序放在我们控制下的不同域上来测试这一点)。
限制数据服务以便只有我们的应用程序可以使用它的正确/最佳/最有效的方法是什么?谢谢!!!
我正在使用 SL 3 和 .NET 3.5。
We have a Silverlight app which we wrote which calls a Silverlight-enabled data service. The Silverlight app cannot require a login, as it is required to present data to the unauthenticated public.
We have some schmoe who took the time to examine our Silverlight app, one way or another figure out what service it is calling, and then wrote his own client to slurp off the data so he can post it on his site and pretend like it is his. We need to prevent this.
How can i limit my data service somehow to ONLY accept requests from my silverlight app? I tried using the allow-from domain uri setting in the clientaccesspolicy.xml file to limit access to the service only from the domain in which the silverlight app sits (say mydomain.com). This did absolutely nothing though, and the service is still serving up requests to clients from outside the domain. (I tested this by putting my SL app on a different domain under our control).
What is the proper/best/most effective way to limit the data service so only our app can use it? Thanks!!!
I'm using SL 3 and .NET 3.5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
clientaccesspolicy.xml 告诉 Silverlight 应用程序它可以使用哪个 Web 服务。不阻止人们访问 Web 服务。
您可以尝试使用身份验证登录,即使这不是必需的。这可以防止“schmoes”访问您的网络服务。
还可以使用 Dotfuscator 来防止“schoes”反汇编您的 Silverlight 应用程序并获取登录名。
The clientaccesspolicy.xml tells the Silverlight application which Webservice it can consume. Not preventing people accessing the Webservice.
You can try using a authentication login even though its not required. This prevents 'schmoes' accessing your webservice.
Also use Dotfuscator to prevent 'schoes' to disassemble your Silverlight application and acquire the login.
Silverlight Web 服务安全性遵循与 ASP.NET 安全性相同的模式,尤其是暴露于 AJAX 的服务。最好的方法是利用 ASP.NET 的身份验证。
RIA 服务是处理此问题的更好方法。它基于 ASP.NET 授权,但会自动在客户端和服务器端进行验证以打击服务欺骗。它可以让您通过向方法添加属性来处理客户端和服务器端授权,这些属性指示该方法需要授权访问,以及需要特定的组或用户的访问权限。
除了线路端安全性和混淆之外,请记住,客户端可以将调试器附加到在其浏览器中运行的 Silverlight 应用程序。请参阅2008 年 11 月 MSDN 杂志安全 IQ 测试中的示例 。
Silverlight webservice security follows the same patterns you'd use for ASP.NET security, especially services exposed to AJAX. The best way to do make use of ASP.NET's authentication.
RIA Services is an even better way to handle this. It rides on top of the ASP.NET authorization, but validates on both the client and server-side automatically to combat service spoofing. It let you take care of both client and server-side authorization by adding attributes to your methods indicating that the method requires authorized access, and by which groups or users if you need to be specific.
In addition to wire-side security and obfuscation, remember that clients can attach a debugger to Silverlight applications running in their browser. See this example from MSDN Magazine's Security IQ Test, November 2008.