我一直在努力让STS在Azure网站上工作。所以我使用默认的互联网模板创建了一个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. ]
我已经尝试了很多方法来实现这个目标,我认为我缺少一些小东西。有没有人遇到这个问题并有解决方案?
答案 0 :(得分:2)
通过关注此博客解决了这个问题
如果您使用VS2012的身份和访问工具,请转到 “配置”选项卡,然后选中“启用Web场准备就绪”复选框 曲奇”