Where exactly does Forms Authentication exist in the Http Pipeline?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
Guess I should've thought of this first but it didn't dawn on me until I saw the answer from @Carl Raymond that I can just crack it open in reflector. So to answer my own question
OnEnter
calls the private methodOnAuthenticate
which passes in the application context and this is where it validates/writes out the Form Auth tickets.In
OnExit
it checks the response for a Http Status Error Code 401 and if it finds it, that's when it redirects to the Login Url.This is handled by an HTTP module, System.Web.Security.FormsAuthenticationModule. If you look at the system-wide web.config file,
c:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
, you can see where it's mentioned in the<httpModules>
section. The site-specific web.config file will inherit the configuration in that file.On each request, the module will look for an authentication cookie. If it's not present, the request is redirected to the login page. On a successful login, an authentication cookie is sent back to the browser. Then on subsequent requests, the browser will send the cookie, which will be validated by the module, and then the request is handled as usual.