Update 11/17/2009: Code released.
The lccOffsitePortalAuthentication (ASP Code) performs a type of proxy service. It allows you to do a background connection to an offsite portal (that utilizes IP authentication), retrieves the cookie, then redirects the user to the portal, allowing them to utilize an outside portal with the proper cookie, but, from an IP outside the authorized range.
This type of process only works with sites that allow access beyond IP authentication, with a provided access code (i.e. id/password, etc..).
There are two sets of the code below. One is the code to 'fill-in', the other is an example of how it would look when filled in.
Requirements
<%@language=VBScript%> <%Response.Buffer = True%> <% Response.CacheControl = "Private" DIM retrieveCookieURL, postCookieURL, siteLicenseId, siteLicensePassword, siteLicensedURL, siteLicensedURLPath Const WinHttpRequestOption_EnableRedirects = 6 siteLicenseId = "[fill me in]" siteLicensePassword = "[fill me in]" siteLicensedURL = "[fill me in]" siteLicensedURLPath = "[fill me in]" retrieveCookieURL = siteLicensedURL & siteLicensedURLPath & "?USERID=" & siteLicenseId & "&PASSWORD=" & siteLicensePassword set xmlHttp = Server.CreateObject("WinHTTP.WinHttpRequest.5.1") xmlHttp.Option(WinHttpRequestOption_EnableRedirects) = FALSE xmlHttp.open "GET", retrieveCookieURL, false xmlHttp.send postCookieURL = siteLicensedURL Response.Redirect postCookieURL Response.Flush %>
<%@language=VBScript%> <%Response.Buffer = True%> <% Response.CacheControl = "Private" DIM retrieveCookieURL, postCookieURL, siteLicenseId, siteLicensePassword, siteLicensedURL, siteLicensedURLPath Const WinHttpRequestOption_EnableRedirects = 6 siteLicenseId = "someSiteId" siteLicensePassword = "somePassword" siteLicensedURL = "http://somesite.somewhere.com" siteLicensedURLPath = "/index.php" retrieveCookieURL = siteLicensedURL & siteLicensedURLPath & "?USERID=" & siteLicenseId & "&PASSWORD=" & siteLicensePassword set xmlHttp = Server.CreateObject("WinHTTP.WinHttpRequest.5.1") xmlHttp.Option(WinHttpRequestOption_EnableRedirects) = FALSE xmlHttp.open "GET", retrieveCookieURL, false xmlHttp.send postCookieURL = siteLicensedURL Response.Redirect postCookieURL Response.Flush %>