我的机器密钥是自动生成的还是隔离的? [英] Is my machine key auto-generated or isolated?

查看:80
本文介绍了我的机器密钥是自动生成的还是隔离的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在同一主机上的ASP.NET MVC 4应用程序(在IIS 7.5中)和使用HttpListener的服务之间共享.ASPXAUTH cookie.

I'm attempting to share .ASPXAUTH cookies between an ASP.NET MVC 4 application (in IIS 7.5) and a service using HttpListener on the same host.

浏览器正确显示了这两个cookie,但是我的服务在FormsAuthentication.Decrypt处接收到System.Web.HttpException: Unable to validate data.,如果这两个应用程序使用不同的机器密钥,我希望可以得到它.

The browser presents the cookies to both correctly, but my service receives System.Web.HttpException: Unable to validate data. at FormsAuthentication.Decrypt, which I would expect if the two applications were using different machine keys.

因此:如何确定我的机器是否配置为使用其他机器密钥?

So: how do I find out if my machine is configured to use different machine keys?

推荐答案

IIS的默认设置是自动生成机器密钥并针对每个应用程序隔离 您可以在machine.config中全局更改此设置,也可以在web.config中更改每个应用程序的本地设置

the default setting of IIS is autogenerate machine-key and isolate per application you can change this setting globaly in your machine.config or localy (per application) in your web.config

有关详细信息,请参见

  • http://technet.microsoft.com/en-us/library/cc772287(v=ws.10).aspx
  • http://technet.microsoft.com/en-us/library/cc754909(v=ws.10).aspx

您可以在IIS管理器中查看计算机密钥的当前设置.有关详细信息,请参见 http ://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx

You can see the current setting for machine-key in IIS manager. For details, see http://blogs.msdn.com/b/amb/archive/2012/07/31/easiest-way-to-generate-machinekey.aspx

这篇关于我的机器密钥是自动生成的还是隔离的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆