Skip to Content
0
Former Member
Oct 19, 2004 at 02:56 AM

How to using SSO on Jco?

227 Views

Hi All,

We have a application that using Jco library to access SAP system, it designed to be deployed variant J2EE platforms, such as SAP J2EE Engine,Tomcat etc, to make fewer changes, we build the Jco connection in our program, not using Jco service that be provided by SAP J2EE Engine.

We must provide two ways to build the Jco connection,

one is connection pool, the other is using SSO. the first

works well with like the following property file and coding:

JcoProperty file:

jco.client.user=edward

jco.client.passwd=password

jco.client.client=800

jco.client.ashost=10.38.8.56

jco.client.sysnr=00

jco.client.lang=EN

Coding:

JCO.addClientPool("POOL_NAME",5,JcoProperty);

But we don't know how to build Jco connection using SSO on SAP J2EE Engine(not using Jco service).

The property is:

jco.client.user=$MYSAPSSO2$

jco.client.getsso2=1

jco.client.client=800

jco.client.ashost=10.38.8.56

jco.client.sysnr=00

jco.client.lang=EN

Coding is:

Properties JcoProperty ...

String SAP_LOGON_TICKET_COOKIE_NAME = "MYSAPSSO2" ;

Cookie[] cookies = pvRequest.getCookies();

for(int i = 0 ; i<cookies.length ; i++)

{

if (cookies<i>.getName().equalsIgnoreCase(SAP_LOGON_TICKET_COOKIE_NAME) )

{

JcoProperty .setProperty("jco.client.passwd",cookies<i>.getValue());

break;

}

}

JCO.Client mvConnection=JCO.createClient(JcoProperty);

The above code make the following exception:

com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: The system is unable to interpret the SSO ticket received

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(Unknown Source)

at com.sap.mw.jco.JCO$Client.connect(Unknown Source)

Is there any good ideas? what do we configurate anything? Or change code?