Moss和非Moss系统的整合-登录问题

      刚做的一个项目,客户要求从一个采用Form认证的系统登录Moss,但是不能让用户再输入用户名和密码;现在客户的环境是这样的存在一个Form认证的系统,Moss是新安装在一个域里面的,但是Form认证的系统没有在域里面,所以存在一个两个系统之间用户同步的问题?这个问题好解决,也不是我们今天的主题,问题是如何做到两个系统的单一登录?
    以前做的只是使用Moss的单一登录,用Moss去登录其他的系统,现在要反过来,用Form认证的系统来登录Moss?

    最后发现了一个比较简单的办法,用AJAX,哈哈就是这个,不多说了,直接贴代码吧!

ContractedBlock.gif ExpandedBlockStart.gif Code
 1None.giffunction InitAjax()
 2ExpandedBlockStart.gifContractedBlock.gif    dot.gif{ 
 3InBlock.gif        var ajax=false;
 4InBlock.gif        try 
 5ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{   
 6InBlock.gif            ajax = new ActiveXObject("Msxml2.XMLHTTP");
 7ExpandedSubBlockEnd.gif       }
 
 8InBlock.gif       catch (e) 
 9ExpandedSubBlockStart.gifContractedSubBlock.gif       dot.gif{   
10InBlock.gif           try 
11ExpandedSubBlockStart.gifContractedSubBlock.gif           dot.gif{    
12InBlock.gif               ajax = new ActiveXObject("Microsoft.XMLHTTP");
13ExpandedSubBlockEnd.gif          }
 
14InBlock.gif          catch (E) 
15ExpandedSubBlockStart.gifContractedSubBlock.gif         dot.gif{    
16InBlock.gif              ajax = false;   
17ExpandedSubBlockEnd.gif          }
  
18ExpandedSubBlockEnd.gif        }
 
19InBlock.gif        
20InBlock.gif        if (!ajax && typeof XMLHttpRequest!='undefined'
21ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{   
22InBlock.gif            ajax = new XMLHttpRequest();  
23ExpandedSubBlockEnd.gif        }
  
24InBlock.gif        return ajax;
25ExpandedBlockEnd.gif     }

26None.gif    
27None.gif    function Login()
28ExpandedBlockStart.gifContractedBlock.gif    dot.gif{
29InBlock.gif        try
30ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
31InBlock.gif            var strName ='aw.com\\sales';
32InBlock.gif            var strPWD = 'pass@word1';
33InBlock.gif            var location = 'http://moss:2000'
34InBlock.gif            var ajax =  new InitAjax();
35InBlock.gif            
36InBlock.gif            ajax.open('post',location,false,strName,strPWD);
37InBlock.gif            ajax.send();
38InBlock.gif            if ( ajax.status == 200 )
39ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
40InBlock.gif                window.location.href =location;
41ExpandedSubBlockEnd.gif            }

42InBlock.gif            
43ExpandedSubBlockEnd.gif        }

44InBlock.gif        catch(e)
45ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{}
46ExpandedBlockEnd.gif    }


转载于:https://www.cnblogs.com/wengnet/archive/2008/10/23/1317538.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值