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)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 迭部县| 安远县| 永康市| 湖州市| 盖州市| 谷城县| 海伦市| 东兴市| 垣曲县| 安顺市| 建水县| 庆城县| 绩溪县| 绥滨县| 磴口县| 鹿泉市| 贵溪市| 松溪县| 巩义市| 讷河市| 太白县| 滕州市| 顺昌县| 秀山| 彝良县| 郑州市| 板桥市| 萨迦县| 南京市| 云浮市| 崇文区| 安陆市| 区。| 白朗县| 甘德县| 阿鲁科尔沁旗| 高尔夫| 台北市| 鄂尔多斯市| 丹寨县| 从江县|