I need to integrate an ASP application, and I tried the sample code in SAPSSOEXT.ZIP first.
1. Put SAPSSOEXT.DLL and SAPSECU.dll to WINNT/system32
2. regsvr32 SAPSSOEXT.DLL
3. Put ssosample.asp and verify.pse under IIS
I created a URL iView of this page, the ASP page can get the ticket right, but can't verify it, here is the error:
"The following error occured:
Ticket verifying failed. Return codes error=1 and ssf error=0"
And the code of ASP page is:
<OBJECT RUNAT=SERVER ID=MyObj PROGID="SAPSSOEXT.SSO2Ticket"></OBJECT>
<!--
(C) Copyright 2000-2005 SAP AG Walldorf
*
Author: SAP AG, Security Development
SAP AG DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL SAP AG BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
-->
<HTML>
<HEAD>
<TITLE>SAPSSOEXT COM sample</TITLE>
</HEAD>
<BODY>
<h1>SAPSSOEXT COM sample call:</h1>
<BR>
<%@ language="VBScript" %>
<%
Dim Cookie 'The cookie we retrieve from the request context
Dim RetArray 'Returnarray from the validation function.
' constants for SAPSSOEXT certificate parser
Const ISSUER_CERT_SUBJECT = 0
Const ISSUER_CERT_ISSUER = 1
Const ISSUER_CERT_SERIALNO = 2
Cookie = request.cookies("MYSAPSSO2")
if Cookie="" then
%>
<h2>Error!</h2><br>
No MYSAPSSO2 cookie found.
<%
else
On error resume next
%>
cookiestring = "<%=Cookie%>"
<%
MyObj.CryptLib = "C:
WINNT
system32
sapsecu.dll"
RetArray = MyObj.EvalLogonTicket (Cookie, "C:
ASPSSO
verify.pse", vbNull)
' RetArray(0) is the user name
' RetArray(1) is the client of the issuing system
' RetArray(2) is the id of the issuing system
' RetArray(3) is the X.509 certificate of the issuing system
' RetArray(4) is the portal user name (if there is one in the ticket)
' RetArray(5) is the authentication schema (if defined)
' RetArray(6) is the validity of the ticket in seconds
%>
<%if err <> 0 then %>
The following error occured:<br>
<%= err.Description %><br><br>
<% else %>
The authenticated user is <b><%=RetArray(0)%>.</b><br>
Additional data:
<table>
<tr><td>Sysid</td><td>=</td><td><%= RetArray(1)%></td></tr>
<tr><td>Client</td><td>=</td><td><%= RetArray(2)%></td></tr>
<tr><td>Portal ID</td><td>=</td><td><%= RetArray(4)%></td></tr>
<tr><td>Suject</td><td>=</td><td><%= MyObj.ParseCertificate(RetArray(3),ISSUER_CERT_SUBJECT)%></td></tr>
<tr><td>Issuer</td><td>=</td><td><%= MyObj.ParseCertificate(RetArray(3),ISSUER_CERT_ISSUER)%></td></tr>
<tr><td>Certificate</td><td>=</td><td><%= RetArray(3)%></td></tr>
<% end if %>
</table>
<% end if %>
</BODY>
</HTML>
Anybody can help me out?
Thanks a lot!
Message was edited by: wayne lou