如何让 HealthVault 在同一应用程序中使用多个 ApplicationID
我们可能永远不知道为什么 Microsoft 决定通过将 HealthVault 应用程序限制为 HealthVault 应用程序的单个 web/app.config 条目来限制开发人员。但是,我需要能够使 2 个(或更多)HealthVault ApplicationID 与一个 ASP.NET 网站一起工作?我正在寻找一种有效且可靠的方法来做到这一点。
我不会详细讨论 2 个不同的 HealthVault 应用程序背后的推理,但除了说我们需要它工作之外。我仍然无法正确登录 MSDN 论坛(想想无限重定向登录循环),所以我希望这里的帖子能够帮助我。
我确实联系了 HealthVault 开发人员,了解如何实现这一目标,但开发人员给出了一个我认为不可靠的建议(如果我错了,请告诉我)。
开发人员的建议是,当您需要连接到 HealthVault 时,但在连接之前,请在代码中执行以下操作:
ConfigurationSettings.AppSettings[“ApplicationId”] =“[您的应用程序 ID]”;
问题是这是一个静态属性,我确实认为这是一个问题,因为我们的 Web 应用程序将有不同的用户同时访问两个 HealthVault 应用程序。 有人建议让 2 个(或更多)HealthVault ApplicationID 与一个 ASP.NET 网站一起使用吗?我正在寻找一种有效且可靠的方法来做到这一点。
We may never know why Microsoft decided to limit developers by making HealthVault applications constrained to a single web/app.config entry for a HealthVault application. However I need to be able to make 2 (or more) HealthVault ApplicationID’s work with one ASP.NET website? I’m looking for an effective and reliable way to do this.
I won’t go into the details of the reasoning behind 2 different HealthVault applications, but other than to say we need it to work. I still cannot login correctly with MSDN Forums (think infinite redirection sign in loop) so I am hoping for a post here that will help me.
I did contact a HealthVault developer on how to achieve this however the developer gave a suggestion that I don’t believe would be reliable (if I’m wrong let me know).
The developer’s suggestion was to do the following in code when you needed to connect to HealthVault, but prior to connecting:
ConfigurationSettings.AppSettings[“ApplicationId”] = “[YOUR APP ID]”;
The problem is that this is a static property and I do see this as an issue as our web application will have different users accessing both HealthVault applications at the same time.
Does anyone have any suggestions to make 2 (or more) HealthVault ApplicationID’s work with one ASP.NET website? I’m looking for an effective and reliable way to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一种方法可以在运行时动态切换应用程序 ID。必须创建两个应用程序,必须安装两个证书。很少有事情需要记住。对于每个经过身份验证的连接,用户将被授予一个令牌(又名 wctoken)。
当用户通过您的redirect.aspx页面(假设您的重定向页面继承自HealthServiceActionPage)从Live ID重定向回来(如果使用了live ID...)时,会消耗此令牌.
这意味着每次切换应用程序时,您必须将用户重定向回具有新应用程序 ID 的 Live ID 以接收新令牌,
以下是用户可以动态更改设置的代码示例:
用法:
There is a way to dynamically switch app ids on runtime. Both applications must be created, both certificates must be installed. Few things to keep in mind. For every authenticated connection, user will be granted a token (aka wctoken).
This token is consumed when user is redirect back from Live ID (in case live id is used...) by your redirect.aspx page (assuming your redirect page inherits from HealthServiceActionPage.
This means that everytime you switch applications, you must redirect user back to Live ID with new app id to receive new token.
Here is code sample that can be user to dynamically change settings:
Usage: