on 08-22-2006 3:14 PM
Dear developers,
I try to create a JCO.Client. So that I can communicate from a Java project/dc to ABAP.
The JCO.CLient api states this (see code below)
=====================================================
<i>public static JCO.Client createClient(java.lang.String client,
java.lang.String user,
java.lang.String passwd,
java.lang.String lang,
java.lang.String ashost,
java.lang.String sysnr,
java.lang.String gwhost,
java.lang.String gwserv)Creates an instance of a client connection to a remote SAP system (no load balancing) Note: Depending on the SAP system release, logins using Single-Sign-On (SSO) or X509 certificates are being supported.
For SSO specify the user to be $MYSAPSSO2$ and pass the base64 encoded ticket as as the passwd parameter.
For X509 specify the user to be $X509CERT$ and pass the base64 encoded certificate as the passwd parameter.</i>=====================================================
So we can use Single-Sign-On (SSO). But I have no idea how we can get the base64 encoded ticket.
My question is: Who have more information about: "how to pass the base64 encoded ticket as the passwd parameter".
And more important. Has someone any code examples.
Thanx in advance.
Kind regards, Marinus
Hi
Try this
// TODO: Receive The Cookie and SSO String values. From Portal
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
Cookie[] cookies = request.getCookies();
String cookieName = "MYSAPSSO2";//SAPCookie;
for ( int i=0; i<cookies.length; i++) {
Cookie cookie = cookies<i>;
if (cookieName.equals(cookie.getName())){
}
}
IUser user1 = WDClientUser.getCurrentUser().getSAPUser();
String sso = (String)user1.getTransientAttribute(IPrincipal.DEFAULT_NAMESPACE, "MYSAPSSO2_STRING");
Pass the String sso as Password
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mukesh,
I am getting the same eror. For trying out the code that you have given, I need the packages that contain the IWebContextAdapter and IPrincipal. From where can i get those packages?
This is the error i am getting...
<i>Error during initialization of SSO2TICKET:
MySapInitialize failed: rc= 14
static part ends.
java.lang.Exception: MySapEvalLogonTicketEx failed: standard error= 9, ssf error= 0
at com.mysap.sso.SSO2Ticket.evalLogonTicket(Native Method)</i>
Hi Mukesh,
Thanks a lot for your answer. It worked straight away.
I rewarded you points.
Kind regards,
Marinus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.