From f87a50234bf53fa281636e1f881a8016fc7fe4b1 Mon Sep 17 00:00:00 2001 From: Ruud Lipper Date: Tue, 13 Oct 2015 08:12:52 +0000 Subject: [PATCH] WELK#34077 svn path=/Website/branches/v2015.2/; revision=26630 --- CUST/WELK/sso/SSOprodWELK.asp | 119 ++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 CUST/WELK/sso/SSOprodWELK.asp diff --git a/CUST/WELK/sso/SSOprodWELK.asp b/CUST/WELK/sso/SSOprodWELK.asp new file mode 100644 index 0000000000..a5d3fa2b01 --- /dev/null +++ b/CUST/WELK/sso/SSOprodWELK.asp @@ -0,0 +1,119 @@ +<%@language="VBScript"%> +<% +'******************************************************************* +'Script: SSO.ASP +' +' $Revision$ +' $Id$ +' +'Doel: SSO bewerkstelligen voor ASP providers - deel 1 van 2 +'******************************************************************* +'* declare ********************************************************* +Dim strGUID, strCTID, strUserName, strKey, strASPUrl, strSharedKey +Dim strEncryptedCode, strControlEncryptedCode +'* variables ******************************************************* +strASPUrl = "https://welk.facilitor.nl?sso=1" 'HTTPS URL adres van ASP +strSharedKey = "GTAvoxLrNVJOaDQsHSqRHShkDVBTpQsn" 'Sharedkey - Should be the same at target side +'******************************************************************* +response.Buffer=true +Dim proto, zelf +If Request.ServerVariables("SERVER_PORT") = 443 Then + proto = "https://" +Else + proto = "http://" +End If +zelf = proto & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") +%> + + + + + +Een moment aub. +
+ +<% +'* request action = requestid *************************************** +strGUID = Request.form("guid") +strCTID = Request.form("ctid") +if strGUID = "" or strCTID = "" then + '* first flow: requestid **************************************** + %> + + " ID="jumpTo"> + <% +else + '* second flow: create code ************************************* + strUserName = Request.ServerVariables("LOGON_USER") + if strUserName = "" then + strUserName = Request.ServerVariables("REMOTE_USER") + if strUserName = "" then + strUserName = Request.ServerVariables("HTTP_USER") + if strUserName = "" then + strUserName = Request.ServerVariables("HTTP_LOGIN") + if strUserName = "" then + 'Forse user to authenticate + response.Clear + response.Status = 401 + response.Flush + response.End + end if + end if + end if + end if + + ' * Strip domain name + Do While instr(strUserName, "\")>0 + strUserName = Mid(strUserName, instr(strUserName, "\") + 1) + Loop + '* crypt ******************************************************** + 'First coding phase + strKey = mid(strSharedKey & strGUID,1,Len(strUserName)) + strEncryptedCode = EnCrypt(strUserName) + 'Second coding phase + strKey = mid(strGUID,1,Len(strEncryptedCode)) + strEncryptedCode = EnCrypt(strEncryptedCode) + '* crypt Controlkey ********************************************* + 'First coding phase + strKey = mid(strSharedKey & strCTID,1,Len(strCTID)) + strControlEncryptedCode = EnCrypt(zelf) + 'Second coding phase + strKey = mid(strCTID,1,Len(strControlEncryptedCode)) + strControlEncryptedCode = EnCrypt(strControlEncryptedCode) + %> + + + + + <% +end if +'* Functions ******************************************************** +Function EnCrypt(strCryptThis) + Dim strChar, iKeyChar, iStringChar, i + for i = 1 to Len(strCryptThis) + iKeyChar = Asc(mid(strKey,i,1)) + iStringChar = Asc(mid(strCryptThis,i,1)) + iCryptChar = iKeyChar Xor iStringChar + strEncrypted = strEncrypted & Chr(iCryptChar) + next + EnCrypt = strEncrypted +End Function +Function ConvertToAsc(strAsc) + Dim iCount + Dim strTemp + ConvertToAsc = "" + for iCount = 1 to len(strAsc) + strTemp = (asc(mid(strAsc,iCount,1))) + ConvertToAsc = ConvertToAsc & len(strTemp) & strTemp + next +End Function +'********************************************************************* +%> +
+ +