与asp.net问题在Internet Explorer窗体身份验证 [英] Problem with asp.net forms authentication in internet explorer

查看:175
本文介绍了与asp.net问题在Internet Explorer窗体身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司有一个托管客户机上的Web应用程序使用窗体身份验证在ASP.net。当访问该网站 http://www.client.com/Application 并试图登录页面上进行身份验证用户被重定向到登录页面。当通过 HTTP访问它:认证//本地主机/应用程序工作正常,用户能够进入该网站。所以我们pretty确保它是与他们的服务器/环境,我们不能复制我们的发展环境这一行为。

My company has a web application hosted on a client's machine that uses forms authentication in ASP.net. When visiting the website http://www.client.com/Application and trying to authenticate on the login page the user gets redirected back to the login page. When accessing it via http://localhost/Application the authentication works fine and the user is able to get into the site. We cannot replicate this behavior in our development environment so we're pretty sure it has something to do with their server/environment.

只有使用Internet Explorer时发生的问题(及IE 6,7测试,8)。当客户端试图获得与火狐,认证工作正常。

The problem only happens when using Internet Explorer (tested with ie 6, 7, 8). When the client tries to get on with firefox, the authentication works fine.

我创建的登录页面,以FormsAuthentication.SetAuthCookie呼叫显示有关身份验证Cookie信息后重定向到一个调试页面。当在Internet Explorer中击中它,身份验证cookie不存在。当在FireFox打它它。

I created a debug page that the logon page redirects to after a call to FormsAuthentication.SetAuthCookie that displays information about the authentication cookie. When hitting it in Internet Explorer, the authentication cookie does not exist. When hitting it in FireFox it does.

有没有人遇到过这样的事情之前或有什么可能是问题有什么建议?

Has anyone encountered something like this before or have any suggestions about what could be the problem?

编辑:

Web.config文件

Web.config

<authentication mode="Forms">
  <forms name=".ASPXAUTH" loginUrl="Login.aspx" />
</authentication>
<authorization>
  <deny users="?" />
  <allow users="*" />
</authorization>   

 <!-- Page used to display authentication cookie information -->
 <location path="AuthDebugPage.aspx">
   <system.web>
     <authorization>
      <allow users="?"/>
     </authorization>      
   </system.web>
 </location>

LogOn.aspx.vb

LogOn.aspx.vb

If (adAuth.IsAuthenticated(Domain, txtUserName.Text, txtPassword.Text)) Then          

  Dim AuthDebug As Boolean =      System.Configuration.ConfigurationSettings.AppSettings("AuthDebug")

  If AuthDebug Then
    FormsAuthentication.SetAuthCookie(SystemUserName, False)
    Response.Redirect("AuthDebugPage.aspx")
  Else
    FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)
  End If
End If

他们域的管理员通过组策略看,看看他们是否被什么推到他们的节点是prevented无法接受的IE浏览器的cookies的用户,他没有发现任何东西。他还参加了一台机器关闭域和清理所有的组策略,并仍然在Internet Explorer验证同样的麻烦。

The admin of their domain looked through the group policy to see if they were pushing anything down to their nodes that prevented users from accepting cookies on IE and he didn't find anything. He also took a machine off the domain and cleaned it of all group policy and still had the same trouble authenticating in internet explorer.

推荐答案

正如约翰说,这是什么环境。我们打​​开无Cookie认证等用户正在正确验证的工作就好了。我们的一个客户发现,当他们使用的只是IP地址访问的网站(例如 http://111.111.111.111 ),该网站正常表现而他们能够得到过去的登录页面,但是当他们使用的DNS名没有。在Internet Explorer中打开了他们的区域确实允许足够的信任外网站(该DNS名称解析也是如此),因为它没有本地Intranet站点有饼干。

As John said it was something environmental. We turned on cookieless authentication and that worked just fine so users were being authenticated correctly. One of our customers discovered that when they used just the IP address to access the website (e.g. http://111.111.111.111) that the website behaved properly and they were able to get past the login page but when they used the DNS name it did not. Turned out their zones in internet explorer did allow enough trust to outside sites (which the DNS name resolved too) as it did local intranet sites to have cookies.

这篇关于与asp.net问题在Internet Explorer窗体身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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