allen
专注于java ee技术,包括struts,jsf,webwork,spring,hibernate,ibatis
posts - 7,  comments - 9,  trackbacks - 0

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<%@ LANGUAGE="VBScript" %>
</HEAD>

<BODY>


<%
 'Declare and assign CAS server variable
 Dim casServer
 casServer = "localhost:8443/cas"

 'Declare additional variables used for redirect
 Dim protocol, originatingURL, caseNetworkID

 'Determine the protocol for the originitating page
 if Request.ServerVariables("HTTPS") = "off" then
  protocol = "http"
 else
  protocol = "https"
 end if

 'Construct the originatingURL variable based on ServerVariables
 'originatingURL = protocol & "://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL")
 originatingURL = protocol & "://localhost"  & Request.ServerVariables("URL")

 'Check to see if the 'ticket' variable was passed via the query string
 if Request.QueryString("ticket") = "" then
  'If no, then redirect to CAS
  Response.Redirect("https://" & casServer & "/login?service=" & originatingURL)
 else
  'If yes, create MSXML object and attempt to validate the ticket
  Dim objSvrHTTP, ticket, casResponse, casResponseArray

  ticket = Request.QueryString("ticket")

  'Set objSvrHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
 
  Set objSvrHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.5.0")
  
  objSvrHTTP.open "GET", "https://" & casServer & "/validate?ticket="+ ticket +"&service=" & originatingURL, false
        objSvrHTTP.setOption(2) = 13056
  objSvrHTTP.send
  casResponse = objSvrHTTP.responseText
  casResponseArray = Split(casResponse, Chr(10), -1, 1)

  if casResponseArray(0) = "no" then
   Response.Redirect("https://" & casServer & "/login?service=" & originatingURL)
  else
   caseNetworkID = casResponseArray(1)
   Response.write caseNetworkID
  end if
 end if
%>

 

</BODY>
</HTML>

posted on 2006-11-15 09:07 robbin163 阅读(704) 评论(1)  编辑  收藏

FeedBack:
# re: asp和sso结合
2011-09-23 08:45 | 记忆有你
这段是如何把sso和asp结合的,请告知QQ。 最近在看sso 但是网上的asp的sso比较少 看到您这段 却没有明白具体的含义,请即使告知,谢谢qq271882889  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航:
 

<2011年9月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

常用链接

留言簿(3)

随笔分类

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜