Form authentication works on dev server but not on IIS

你离开我真会死。 提交于 2019-12-02 15:21:07

问题


We have a similar problem. We have a web application running under default appdomain. It was working fine until a week before...Suddenly it has encountered a problem. Below message is taken from event logs.

Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired. 

Application uses FormsAuthentication and gets the roles from aspnetdb.. After the error, when user logins to the page, it does not redirects to the default.aspx. Again login.aspx comes up. On the other hand application works fine on development server(localhost), but not on www(IIS 6.0).

Does any one has an idea?

Thanks,

İlknur


回答1:


It looks that when Application Pool your app is running on is in Integrated Managed Pipeline Mode, which is default under IIS 7, you will need to add

<system.webServer>
  <modules>
      <add  name="FormsAuthenticationModule"  type="System.Web.Security.FormsAuthenticationModule" />

To configuration.

Please refer to [Performing Forms-Based Authentication and URL Authentication on Static Files with IIS 7] section from this article

Initially I added aforementioned section to web.config by hand, but IIS complained with runtime error, so I ended up using MMC panel for IIS (inetmgr) to add it via GUI. Application's config file wasn't modified, but feature started to work, so I'm not sure which configuration file GUI tool applied the change to.



来源:https://stackoverflow.com/questions/2221192/form-authentication-works-on-dev-server-but-not-on-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!