在浏览器信任的应用程序 Silverlight 5 中

发布于 2024-12-21 22:22:42 字数 949 浏览 3 评论 0原文

借助新的 Silverlight 5,我们现在可以拥有浏览器内增强信任的应用程序。 但是,我在部署该应用程序时遇到了一些问题。

当我从 Visual Studio 测试应用程序时,一切正常,因为如果网站托管在本地计算机(localhost,127.0.0.1)上,它会自动授予所有权利。

我在 MSDN 上看到,我必须遵循 3 个步骤才能使其在任何网站上运行:

  1. 对 XAP 进行签名 — 我按照 Microsoft 教程进行了
  2. 安装受信任的发布者证书存储 — 我也按照 Microsoft 教程进行了
  3. 添加注册表项值AllowElevatedTrustAppsInBrowser

第三步是我最不确定的一步。我们需要在本地计算机还是服务器上添加此注册表项? Silverlight中是否有任何自动功能来添加此键,或者最好制作一个批处理文件?

即使完成了这三个步骤,当从 localhost 以外的其他 URL 调用时,应用程序仍然无法工作。

有人成功实施了浏览器内提升信任的应用程序吗?你看到我做错了什么了吗?

来源:

With the new Silverlight 5, we can now have an In-Browser elevated-trust application.
However, I'm experiencing some problems to deploy the application.

When I am testing the application from Visual Studio, everything works fine because it automatically gives every right if the website is hosted on the local machine (localhost, 127.0.0.1).

I saw on MSDN that I have to follow 3 steps to make it work on any website:

  1. Signed the XAP — I did it following the Microsoft tutorial
  2. Install the Trusted publishers certificate store — I did it too following the Microsoft Tutorial
  3. Adding a Registry key with the value AllowElevatedTrustAppsInBrowser.

The third step is the one I am the most unsure about. Do we need to add this registry key on the local machine or on the server? Is there any automatic function in Silverlight to add this key or is it better to make a batch file?

Even with those three steps, the application is still not working when called from another url than localhost.

Does anybody have successfully implemented an in-browser elevated-trust application? Do you see what I'm doing wrong?

Sources:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

仙气飘飘 2024-12-28 22:22:42

有很多很好的资源描述了这个过程,包括这里的回复中提到的资源。我想记录对我们有用的步骤。 (Silverlight 5.1.10411.0)

以下是我们启用浏览器内可信应用程序所采取的步骤:

  1. 使用代码签名密钥对 Xap 文件进行签名。
  2. 将公共代码签名密钥安装到“证书 -> 当前用户 -> 受信任的发布者”
  3. 中 在
    SL 64 位路径:HKLM\Software\Wow6432Node\Microsoft\Silverlight

    处设置 DWORD 注册表项AllowElevatedTrustAppsInBrowser = 1< pre>SL 32 位路径:HKLM\Software\Microsoft\Silverlight

  4. 在文本编辑器并验证以下条目是否存在:
    true
    Properties\InBrowserSettings.xml
    
  5. 检查 Properties\InBrowserSettings.xml 是否存在并包含:
    
     
       
      
    
    

注意:

  • 如果您在测试时使用自签名证书,还需要将其安装到“证书->当前用户->受信任的根证书颁发机构”中。 (在投入生产之前购买一个)
  • 一旦您签署了 XAP 文件,您就无法解压缩并修改它,因为这样做会破坏签名(必须重新签署)。
  • 如果您正在缓存 xap 文件,请不要忘记清除浏览器缓存。
  • 这适用于 Windows 7 和 Windows 8 Release Preview(桌面模式)以及 IE、Chrome、Firefox 和 Safari。

There are lots of great resources describing this process, including the ones mentioned in responses here. I wanted to document the steps that worked for us. (Silverlight 5.1.10411.0)

Here are the steps that we took to enable In-Browser Trusted Applications:

  1. Sign the Xap file with code signing key.
  2. Install public code signing key into "Certificates->Current User->Trusted Publishers"
  3. Set the DWORD registry key AllowElevatedTrustAppsInBrowser = 1 at
    SL 64 bit path: HKLM\Software\Wow6432Node\Microsoft\Silverlight
    SL 32 bit path: HKLM\Software\Microsoft\Silverlight
  4. Open the Silverlight project in a text editor and verify the following entries exist:
    <RequireInBrowserElevation>true</RequireInBrowserElevation>
    <InBrowserSettingsFile>Properties\InBrowserSettings.xml</InBrowserSettingsFile>
    
  5. Check that the Properties\InBrowserSettings.xml exists and contains:
    <InBrowserSettings>
      <InBrowserSettings.SecuritySettings>
        <SecuritySettings ElevatedPermissions="Required" />
      </InBrowserSettings.SecuritySettings>
    </InBrowserSettings>
    

Note:

  • If you use a self signed certificate while testing, you will also need to install it into "Certificates->Current User->Trusted Root Certification Authorities". (Buy one before you go into production)
  • Once you sign a XAP file you cannot unzip and modify it as doing so breaks the signing (it must be resigned).
  • Don't forget to clear your browser cache if you are caching the xap file.
  • This worked on Windows 7 and Windows 8 Release Preview (desktop mode) with IE, Chrome, Firefox and Safari.
帅的被狗咬 2024-12-28 22:22:42

我已成功创建具有提升权限的浏览器内 Silverlight 5 应用程序 这篇 msdn 文章
您可以随时检查您的应用程序是否已提升权限:

Application.Current.HasElevatedPermissions

我的问题是,虽然它在 Firefox 14 中运行没有问题,但 IE9 需要在 Windows 7 中以管理员身份运行。
我目前正在寻找一种方法,使其能够在不以管理员身份执行 IE 的情况下工作。
如果有人知道如何做到这一点,我将不胜感激。

编辑:

哇。实际上,来自 Aaron McIver 帖子的链接对我帮助很大。我刚刚关闭了“启用保护模式”,现在无需管理员权限即可正常工作。
:D

I have successfully created in-browser Silverlight 5 app with elevated privileges fallowing this msdn article.
You can always check if Your app has elevated privs with:

Application.Current.HasElevatedPermissions

My problem is that while it works without problem in Firefox 14, IE9 needs to be run as administrator in Windows 7.
I am currently looking for a way to make it work without executing IE as administrator.
If anybody knows how to do this I would appreciate the help.

Edit:

Wow. Actually link from Aaron McIver post helped me a lot. I just switched "Enable protected mode" off and now it works just fine without administrator rights.
:D

半仙 2024-12-28 22:22:42

注册表编辑需要在客户端计算机上进行;执行 Silverlight 应用程序的计算机。

有一个演示,通过XAMLGEEK;因为你所安排的一切都应该让你处于工作状态。 Mike Taulty 还有一个 出色的演练

The registry edit needs to be on the client machine; the machine executing the Silverlight application.

There is a demo available via the XAMLGEEK; as everything you laid out should get you in a working state. Mike Taulty also has an excellent walk through.

深居我梦 2024-12-28 22:22:42

我想将 silverlight 应用程序连接到托管应用程序的同一主机地址上端口 10001 上的套接字。

是否可以在不更改客户端任何内容的情况下完成此操作?

I would like to connect with silverlight app to socket on port 10001 on same host address where app is hosted.

Is it possible to done that without changing anything on client side?

£噩梦荏苒 2024-12-28 22:22:42

我也面临同样的问题

当我们使用仅适用于本地计算机的测试证书时,

。您必须使用另一个证书签署您的应用程序,它才能工作。

问题链接 Silverlight 5 在浏览器可信应用程序中

i am also face same kind of problem

when we use test certificate that will work only for local machine.

you have to sign your app with another certificate , and it will work.

question link Silverlight 5 In browser trusted application

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文