如何编写安全的ClientAccessPolicy.xml文件?

时间:2010-01-14 21:05:16

标签: wcf silverlight security web clientaccesspolicy.xml

我正在使用ClientAccessPolicy.xml文件,我认为它几乎可以访问我的WCF服务:

<?xml version=""1.0"" encoding=""utf-8""?>
    <access-policy>
        <cross-domain-access>
            <policy>
                <allow-from http-request-headers=""*"">
                    <domain uri=""*""/>
                </allow-from>
                <grant-to>
                    <resource path=""/"" include-subpaths=""true""/>
                </grant-to>
            </policy>
        </cross-domain-access>
    </access-policy>"

到目前为止,我只想允许我的Silverlight应用程序,我的网站(MVC2,如果这很重要)能够访问该服务,但我不知道如何修改我的策略文件来做到这一点。我真的不知道他们每个人需要什么类型的访问权限。有人可以推荐一个很好的资源来解决这个问题,并建议如何专门处理我的clientaccesspolicy.xml文件以使我的服务安全,但仍然可以通过BasicHttpBindings和WebHttpBindings获得?

1 个答案:

答案 0 :(得分:2)

查看HTTP Communication and Security with Silverlight

我发现这对这些问题非常有帮助。