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 閱讀(720) 評論(1)  編輯  收藏

          FeedBack:
          # re: asp和sso結合
          2011-09-23 08:45 | 記憶有你
          這段是如何把sso和asp結合的,請告知QQ。 最近在看sso 但是網上的asp的sso比較少 看到您這段 卻沒有明白具體的含義,請即使告知,謝謝qq271882889  回復  更多評論
            

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 东台市| 黄骅市| 凉城县| 景德镇市| 延寿县| 白朗县| 金湖县| 清原| 福建省| 巴中市| 阿勒泰市| 呼玛县| 济阳县| 当涂县| 含山县| 赣榆县| 平顺县| 大宁县| 宽甸| 资阳市| 高要市| 钦州市| 洛川县| 鄢陵县| 东阿县| 土默特左旗| 普陀区| 南郑县| 砀山县| 玉门市| 兴安盟| 长寿区| 农安县| 肇庆市| 新和县| 上高县| 郯城县| 丹巴县| 商洛市| 奎屯市| 乌拉特前旗|