How does ASP.NET Forms Authentication really work?
I've always wondered how exactly ASP.NET forms authentication works. Yes, I know how to configure Forms Authentication, but how does forms authentication work in the background?
- User tries to access restricted page.
- Server looks for ASPXAuth cookie in the request but does not find it.
- Server redirects user to Login page as configured in web.config.
- User enters username and password and posts to the server.
- Server authenticates username and password against store. If valid...
- Server sets the Forms Authentication Ticket.
- The ticket contains (among other things) the userName, IsPersistent and the ExpirationDate.
- The ticket is encrypted and signed using keys from the <machineKey> configuration element (either from web.config or from machine.config)
- The ticket is stored in a cookie called ASPXAuth, or in the user's URL.
- Server redirects user back to the referring URL.
- User's browser requests original restricted page again. This time with the ASPXAuth cookie in the request.
- Server looks for ASPXAuth cookie and finds it.
- Server decrypts Forms Authentication Ticket found in the cookie.
- Server checks expiration on ticket. If this is still valid...
- Server now knows that the user is authenticated and knows the UserName. From here authorization can take place (i.e. code can call the database and find out if the user has access to specific features on the page)
How does ASP.NET Forms Authentication really work?的更多相关文章
- ASP.NET 4.0 forms authentication issues with IE11
As I mentioned earlier, solutions that rely on User-Agent sniffing may break, when a new browser or ...
- Forms Authentication in ASP.NET MVC 4
原文:Forms Authentication in ASP.NET MVC 4 Contents: Introduction Implement a custom membership provid ...
- ASP.NET Session and Forms Authentication and Session Fixation
https://peterwong.net/blog/asp-net-session-and-forms-authentication/ The title can be misleading, be ...
- ASP.NET Forms 身份验证
ASP.NET Forms 身份验证 在开发过程中,我们需要做的事情包括: 1. 在 web.config 中设置 Forms 身份验证相关参数.2. 创建登录页. 登录页中的操作包括: 1. 验证用 ...
- Nancy之Forms authentication的简单使用
一.前言 想必大家或多或少都听过微软推出的ASP.NET Identity技术,可以简单的认为就是一种授权的实现 很巧的是,Nancy中也有与之相类似的技术Authentication,这两者之间都用 ...
- 细说ASP.NET Forms身份认证
阅读目录 开始 ASP.NET身份认证基础 ASP.NET身份认证过程 如何实现登录与注销 保护受限制的页面 登录页不能正常显示的问题 认识Forms身份认证 理解Forms身份认证 实现自定义的身份 ...
- 简单的ASP.NET Forms身份认证
读了几篇牛人的此方面的文章,自己也动手做了一下,就想有必要总结一下.当然我的文章质量自然不能与人家相比,只是写给从没有接触过这个知识点的朋友. 网站的身份认证我以前只知道session,偶然发现一些牛 ...
- IE11下ASP.NET Forms身份认证无法保存Cookie的问题
IE11下ASP.NET Forms身份认证无法保存Cookie的问题 折腾了三四天,今天才找到资料,解决了. 以下会转贴,还没来得及深究,先放着,有空再学习下. ASP.NET中使用Forms身份认 ...
- ASP.NET Forms身份认证
asp.net程序开发,用户根据角色访问对应页面以及功能. 项目结构如下图: 根目录 Web.config 代码: <?xml version="1.0" encoding= ...
随机推荐
- python 字符串前面加r,u的含义
u/U:表示unicode字符串 不是仅仅是针对中文, 可以针对任何的字符串,代表是对字符串进行unicode编码. 一般英文字符在使用各种编码下, 基本都可以正常解析, 所以一般不带u:但是中文, ...
- ABCD 谁是小偷
题目: 警察局抓了a,b,c,d 4名偷窃嫌疑犯,其中只有一人是小偷.审问中,a说:“我不是小偷.”b说:“c是小偷.”c说:“小偷肯定是d.”d说:“c在胡说.” 现在已经知道这四人中有三人说的是真 ...
- dubbo-admin监控搭建2.6.0版本
首先介绍一下dubbo的一个比较大的改变,那就是在2.6.1及2.6.1以后的版本当中,dubbo将一分为二,分为Dubbo-RPC和Dubbo-Admin,而在2.6.1以前的版本中Dubbo-Ad ...
- linux上安装rz和sz
简介 lrzsz 官网入口:http://freecode.com/projects/lrzsz/ lrzsz是一个unix通信套件提供的X,Y,和ZModem文件传输协议 windows 需要向ce ...
- deep_learning_Function_tensorflow_unpack()
tf.unpack(A, axis)是一个解包函数.A是一个需要被解包的对象,axis是一个解包方式的定义,默认是零,如果是零,返回的结果就是按行解包.如果是1,就是按列解包. 例如: from te ...
- 2019.10.28sql注入工具
SQLMAP工具的使用 sql注入工具:明小子 啊D 萝卜头 穿山甲 sqlmap等等 开源自动化注入利用工具,支持12中数据库,在/plugins中可以看到支持的数据库种类 支持的注入类型:bool ...
- zabbix 4 自带 php、httpd漏洞升级
Zabbix 自带的 PHP 5.4.apache httpd 2.4.6扫描出安全漏洞,需要进行升级. PHP # php -v PHP 5.4.16 (cli) (built: Apr 12 20 ...
- mysql总结1
修改表名:alter table table_name rename new_table_name; 添加字段:alter table table_name add column_name type_ ...
- HTML5 Geolocation学习
GeolocationAPI学习,我写的挺枯燥的,直接跳到最后看示例. 5.1 位置信息 HTML5 Geolocation API的使用方法相当简单.请求一个位置信息,如果用户同意,浏览器就会返回位 ...
- Java技术综述
自己打算好好学习下Java,所以想先明晰Java开发中到底有哪些技术,以便以后学习的过程中,可以循序渐进,随着学习的深入,本文将不断更新. Java基础教程将Java的入门基础知识贯穿在一个实例中,逐 ...