Basic验证的Domain处理
来源:互联网 发布:淘宝全屏海报怎么制作 编辑:程序博客网 时间:2024/05/21 15:39
Basic验证的Domain处理
Email:zfive5@yahoo.com.cn
Author:zfive5(zhaozi)
发觉自己对网络编程真是有些末名的潜力,过去编写basic代理认证时,往往乎略Domain,最近发现Domain在basic的编码中也有体现!
如果有域值的需要这样的:
"Proxy-Authorization:Basic"+" "+Base64(Domain+“/"+UserName+":"+Password)
"WWW-Authorization:Basic"+" "+Base64(Domain+“/"+UserName+":"+Password)
如果没有域值:
"Proxy-Authorization:Basic"+" "+Base64(UserName+":"+Password)
"WWW-Authorization:Basic"+" "+Base64(UserName+":"+Password)
.NET下的Reflector反编译的代码
NetworkCredential credential1 = credentials.GetCredential(httpWebRequest.ChallengedUri, BasicClient.Signature);
if (credential1 == null)
{
return null;
}
string text1 = credential1.UserName;
string text2 = credential1.Domain;
if (ValidationHelper.IsBlankString(text1))
{
return null;
}
string text3 = (!ValidationHelper.IsBlankString(text2) ? (text2 + @"/") : "") + text1 + ":" + credential1.Password;
byte[] buffer1 = BasicClient.EncodingRightGetBytes(text3);
string text4 = "Basic " + Convert.ToBase64String(buffer1);
return new Authorization(text4);
源码之下,确实可以解决一些疑问。
- Basic验证的Domain处理
- Grails Domain自动验证的i18n
- Basic WebLogic Server Domain 创建
- httpd基于basic验证的目录访问
- 实现基于basic验证的目录访问
- Visual Basic的调试和错误处理
- Node.js 异步异常的处理与domain模块解析
- Node.js 异步异常的处理与domain模块解析
- Node.js 异步异常的处理与domain模块解析
- Struts验证的处理
- 验证码的处理
- Tomcat 中的 BASIC验证
- Http Basic Authorizaition验证
- tomcat basic验证
- Visual Basic图像处理
- 使用Visual Basic 6实现真正实用的多线程处理
- 简单的验证码处理
- ASIHttpRequest登录与Basic验证
- FC6硬盘安装小记
- Google的自动化测试大会
- Selinium测试自动化工具
- 出色图形用户界面(GUI)设计规范
- MapGuide Enterprise 2007组件介绍
- Basic验证的Domain处理
- IIS+PHP+MySQL+Zend Optimizer+GD库+phpMyAdmin安装配置[完整修正实用版]
- 如何在Autodesk MapGuide Studio 里组织数据
- nehe第九课的一些感想
- Unbreakable Linux PK UnFakeable Linux
- 空(标识)接口的重要性
- 对MSDN中关于ToolboxBitmap属性补充
- CLSID与ProgID彼此间相互转换
- SMS学习笔记(一)