在ASP.NET单点登录 - cookie的名称,将machineKey和什么呢? [英] Single sign on in ASP.NET - cookie name, machineKey and what more?

查看:156
本文介绍了在ASP.NET单点登录 - cookie的名称,将machineKey和什么呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我主持一台服务器上的两个ASP.NET应用程序。他们CONFIGS有相同的machineKey值和验证部分如下所示:

 <身份验证模式=表格>
      <形式loginUrl =/ _登录/ Default.aspx的NAME =MySingleAuth。/>
    < /认证><身份验证模式=表格>
      <形式loginUrl =〜/ MySingle /登录/ 0超时=2880NAME =。MySingleAuth/>
    < /认证>

这是(在使用一个cookie的这两个应用程序认证)的单点登录仍然无法正常工作。我缺少什么?

编辑:这两个应用程序都在我们的内联网,一是根据的https:// IP:84 下的的https:// IP:86 (其中ip为IP)


解决方案

对于我来说,对于单一登入以下配置工作:

 <的machineKey
  validationKey=\"818B77A6AFBF5E0B82B7FBE6F992E1733986DAEF81D1EB107B55D6F68EB6FEC6097349A9E37A407A6B5CF2FA1AB9327CA182A2C999A768C14B146036420203F9\"
  decryptionKey =45798D54477D1D11BFC16733786AABB50E7FD5DDB3F8F46A
  验证=SHA1
/><身份验证模式=表格>
  <ASPXAUTH形式的名称= loginUrl =〜/的Login.aspx保护=全部无Cookie =UseCookiesenableCrossAp predirects =真/>
< /认证>


  1. 请务必在两个应用程序键是完全相同(验证和解密)

  2. cookie的名称必须是相同

  3. 单一登入仅当你在同一个域(饼干)的工作。

阅读此页,它帮助我:<一href=\"http://www.$c$cproject.com/KB/aspnet/SingleSignon.aspx\">http://www.$c$cproject.com/KB/aspnet/SingleSignon.aspx

I have two ASP.NET apps hosted on one server. Their configs have the same machineKey values and the authentication sections look as follows:

<authentication mode="Forms">
      <forms loginUrl="/_login/default.aspx" name=".MySingleAuth" />
    </authentication>

<authentication mode="Forms">
      <forms loginUrl="~/MySingle/LogOn/0" timeout="2880" name=".MySingleAuth"/>
    </authentication>

The single sign on (authentication in both applications using one cookie) still doesn't work. What am I missing?

Edit: The two apps are on our intranet, one under https://ip:84 and the other under https://ip:86 (where ip is an IP).

解决方案

For me, the following configuration for SingleSignOn worked:

<machineKey
  validationKey="818B77A6AFBF5E0B82B7FBE6F992E1733986DAEF81D1EB107B55D6F68EB6FEC6097349A9E37A407A6B5CF2FA1AB9327CA182A2C999A768C14B146036420203F9"
  decryptionKey="45798D54477D1D11BFC16733786AABB50E7FD5DDB3F8F46A"
  validation="SHA1"
/>

<authentication mode="Forms">
  <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" protection="All" cookieless="UseCookies" enableCrossAppRedirects="true"/>
</authentication>

  1. Be sure the keys on the two applications are absolutely identical (validation and decryption)
  2. The cookie name must be the same
  3. SingleSignOn is only working if you are on the same domain (cookies).

Read this page, it helped me: http://www.codeproject.com/KB/aspnet/SingleSignon.aspx

这篇关于在ASP.NET单点登录 - cookie的名称,将machineKey和什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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