LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Passing ClientCertificate data from excel to asp/aspx

I have an Excel app in VBA which accesses asp pages
producing dynamic serialized datasets in xml from ADO.
This is sensitive data (mortgage rates and lenders
conditions) which needs to be protected. I decided to use
Client Certificates to identify uniquely the Excel client
to the asp page which produces the xml to be read by Excel.

Non secured, the application works OK. I try now to secure
it from the serving asp page (I also tried using asp.net
with no more results). What I want to do in the xml
generating asp page is read the ClientCertificate with
Request.ClientCertificate("SubjectEMAIL"), then I use this
email adress to verify the user exists and still still
active in our sql DB.

The standalone .asp page works fine, detects the
certificate and allows the program to manipulate the
certificate data and act accordingly, if the certificate
is valid and User stil active, I return the serialized
dataset in xml, other wise I return nothing to the calling
Excel VBA.

The issue I have is that once called within Excel, the asp
page which checks the client certificate data does not
work and returns a security error. If I run the page
outside of Excel in IE it pops-up a window to chose which
certificate to send to the requiring asp page and then
asks again for OK to send private Key, I think this is
where my problem stems from, Excel probably does not do
this automatically.

Does anybody have any idea as how to handle this?

Code for asp certif reading page:
<%@Language="VBScript"%
<%
Response.ContentType = "text/xml"
'Response.Expires = 0
Response.Buffer = False
'Response.IsClientConnected
'Response.write "Jusqu'au : " & Request.ClientCertificate
("ValidUntil") & "<br"

dim em, dtUntil, cert, usact, dtOK, usid
'em=Request.ClientCertificate("SubjectCN")
em=""
cert=0
em=Request.ClientCertificate("SubjectEMAIL")
if Request.ClientCertificate("Flags")="1" then
cert=1
else
cert=0
end if

if isDate(Left(Request.ClientCertificate("ValidUntil" ),
10)) then
dtOK=CDate(Left(Request.ClientCertificate("ValidUn til"),
10))
elseif isDate(Left(Request.ClientCertificate
("ValidUntil"), 9)) then
dtOK=CDATE(Left(Request.ClientCertificate("ValidUn til"),
9))
elseif isDate(Left(Request.ClientCertificate
("ValidUntil"), 8)) then
dtOK=CDate(Left(Request.ClientCertificate("ValidUn til"),
8))
else
dtOK=0
end if

dtUntil = Request.ClientCertificate("ValidUntil")
%
<!--#include file="../Connections/MPH.asp" --
<%
Dim rsUser__M1
rsUser__M1 = ""
If (em < "") Then
rsUser__M1 = em
End If
%
<%
Dim rsUser
Dim rsUser_numRows

Set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.ActiveConnection = MM_MPH_STRING
rsUser.Source = "SELECT UserID, sexe, Lang1,
IntranetLevel, CallCenter, Active FROM dbo.Users WHERE
((EMail<'' AND EMail='" + Replace(rsUser__M1, "'", "''")
+ "') OR (EMailOther='" + Replace(rsUser__M1, "'", "''")
+ "' AND EMailOther<'')) AND Active=1"
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 1
rsUser.Open()

rsUser_numRows = 0
%


<%
if rsUser.eof=false then
usact="OK"
usid = rsUser.Fields.Item("UserID").value
else
usact="Problem"
usid=" "
end if

Response.Write "<?xml version='1.0'?" & vbNewLine
Response.write "<AccesGrille" & vbNewLine
Response.write "<Certif Present='" & cStr(cert)
& "' Valid='" & Cstr(dtOK) & "' UserActif='" & usact & "'
UserID='" & usid & "' /" & vbNewLine
response.write "</AccesGrille" & vbNewLine
%

<%
rsUser.Close()
Set rsUser = Nothing
%
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PASSING DATA FROM USER FORM TO EXCEL SPREADSHEET No Name Excel Programming 12 January 7th 04 01:36 PM
Passing data between spreadsheets Kat[_5_] Excel Programming 1 November 4th 03 09:59 PM
ASPX can't change PageSetup property of Chart Lowell Excel Programming 2 October 10th 03 01:00 AM
Passing Data to Outlook Jason[_19_] Excel Programming 0 August 26th 03 06:57 AM
passing data from one sheet to another billabong Excel Programming 4 July 13th 03 01:15 AM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"