一个自定义集成身份验证的好例子
2006-04-18 16:12
429 查看
在写webservice 时,最痛苦的就是身份验证了,用什么都不合适。开始觉着用集成身份验应该不错了,但权限和用户又都是windows自已的程序没法控制,最后几经周折,要网上找到这个例子(出处找不到了,如果作者看到可以说一声,我再加上),感觉实现起来比较好,是能过 重写 IHttpModule实现截取用户名自定义自份验证的。这样就可以自已定义集成身份的用户的名称,角色之类的,再把web方法做为规则名称,用企业类库里的安全模块来进行验证,自认为是个比较好的办法了。(有一个缺点就是在vs里加web引用由于需要验证把以添加web引用不好使。最后用wsdl加用户名密码的方式好使了。
digest.zip
以下是用wsdl添加引用的bat文件代码(其实这个msdn上就有,放在这里只是为了给哪些不想查msdn的人一个方便)。
wsdl
visualStudioDir=D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\
set namespace=Umen.Common.WebRef
set outDir=d:\
set outFileName=Reference.cs
set username=ylx
set password=yan.lixin
set webServiceUri=http://10.0.0.19:8082/WebServiceUmenMembershipOP.asmx
echo %visualStudioDir%wsdl.exe /namespace:%namespace% /out:%outDir%%outFileName% /username:%username% /password:%password% %webServiceUri%
@call "%visualStudioDir%wsdl.exe" /namespace:Umen.Common.WebRef /out:Reference.cs /username:ylx /password:yan.lixin http://10.0.0.19:8082/WebServiceUmenMembershipOP.asmx
digest.zip
以下是用wsdl添加引用的bat文件代码(其实这个msdn上就有,放在这里只是为了给哪些不想查msdn的人一个方便)。
wsdl
visualStudioDir=D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\
set namespace=Umen.Common.WebRef
set outDir=d:\
set outFileName=Reference.cs
set username=ylx
set password=yan.lixin
set webServiceUri=http://10.0.0.19:8082/WebServiceUmenMembershipOP.asmx
echo %visualStudioDir%wsdl.exe /namespace:%namespace% /out:%outDir%%outFileName% /username:%username% /password:%password% %webServiceUri%
@call "%visualStudioDir%wsdl.exe" /namespace:Umen.Common.WebRef /out:Reference.cs /username:ylx /password:yan.lixin http://10.0.0.19:8082/WebServiceUmenMembershipOP.asmx
相关文章推荐
- Shiro中最简单的一个身份验证例子
- 从EntLib(1.0)的一个例子理解身份验证的三个概念。
- 一个Spring Boot, JWT,AugularJS接口安全验证的简单例子
- 一个自定义函数的 例子 知道圆面积 求周长
- hadoop的序列化分析及一个自定义Writable的简单例子
- 一个自定义FrameworkElement的例子
- jmail的一个身份验证问题
- jQuery Validate 表单验证插件----自定义一个验证方法
- 自定义动态生成页面打印以及打印预览的一个实现例子
- 使用struts2自定义拦截实现统一的身份验证模式
- ado.net 集成身份验证代码
- 今天来用一个例子来详细讲解下nutch当中到底是如何自定义插件的
- 一个验证HashMap在多线程环境下线程不安全的例子及dump分析
- ASP.NET自定义身份验证的实践
- 自定义View的一个例子(这里使用了使用了自定义Button)
- Spring AOP自定义注解 身份验证
- 用jsp<html:file>实现一个文件上传的例子,而且有验证
- 第一次用javascript写了一个不用刷新就能实现--用户名验证的例子
- SQL SERVER SA密码忘记,windows集成身份验证都登录不了不怎么办