2

我一直试图让 STS 在 Azure 网站上运行。所以我使用默认的 Internet 模板创建了一个 MVC4 应用程序。然后,我在 Azure 中创建了一个 STS,并使用 Identity and Access 菜单来设置联合安全性。然后,我将 [Authorize] 标记添加到控制器中的方法中,并且浏览器被正确重定向到 STS,我可以在其中输入我的 LiveId 帐户。但后来我得到这个错误

  An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code

[CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.]

[InvalidOperationException: ID1074: A CryptographicException occurred when attempting to encrypt the cookie using the ProtectedData API (see inner exception for details). If you are using IIS 7.5, this could be due to the loadUserProfile setting on the Application Pool being set to false. ]

我已经尝试了很多方法来让它工作,我认为我缺少一些小东西。有没有人遇到过这个问题并有解决方案?

4

1 回答 1

2

通过关注这个博客解决了这个问题

http://blogs.msdn.com/b/vbertocci/archive/2013/01/28/running-wif-based-apps-in-windows-azure-web-sites.aspx

如果您使用的是 VS2012 的身份和访问工具,只需转到“配置”选项卡并选中“启用 Web 场就绪 cookie”框</p>

于 2013-02-02T08:34:02.867 回答