Dim casserver
Casserver = "localhost: 8443/CAS"
'Destare additional variables used for redirect
Dim protocol, originatingurl, casenetworkid
'Termine 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 & ": // 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 +" & url = "& originatingurl)
Else
Dim objsvrhttp, ticket, casresponse, casresponsearray
Ticket = request. querystring ("ticket ")
Set objsvrhttp = server. Createobject ("msxml2.serverxmlhttp. 5.0 ")
Objsvrhttp. Open "get", "https: //" & casserver & "/validate? Ticket = "+ ticket +" & service = "& originatingurl, false
'Response. Write "https: //" & casserver & "/validate? Ticket = "+ ticket +" & service = "& originatingurl
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)
If casenetworkid = "masterqi" then
'Read the database and set the user session Value
Session ("netid") = "masterqi"
Session ("userid") = "592"
Session ("username") = "masterqi"
Session ("color") = "masterqi3"
Session ("corpid") = "116"
Session ("deptid") = "144"
Session ("deptname") = "Technology Development Department"
Session ("password") = "0000"
Session ("corpidlist") = "116,144,145,146,157,158,159"
Session ("screenwidth") = 1024
End if
End if
End if
========================================================== ======================================
If an error is reported in the send method in your current debugging, use serverxmlhttp.4.0 or serverxmlhttp.5.0.
Add objsvrhttp. setoption (2) = 13056 to solve the problem.