on 04-29-2015 5:59 PM
Hi,
Is there a way to generate a logon ticket in an EJB?
I face the following problem: on server A(SAP ABAP) there is a web service, which I consume on server B(SAP Java AS) and create a REST, which is called from an UI5 application on server C(SAP Gateway).
When I call the consumed service from server B via WSNavigator or EJB explorer its working. BUT when the service is called by the REST its throwing the following exception:
Error while creating assertion ticket on demand. No logged in user found.
Assertion ticket could not be retrieved. Error was No logged in user found.. [EXCEPTION] java.lang.IllegalStateException: No logged in user found. at com.sap.security.core.server.jaas.SAPLogonTicketHelper.createAssertionTicket(SAPLogonTicketHelper.java:496) at com.sap.security.core.server.jaas.AssertionTicketFactoryImpl.createAssertionTicket(AssertionTicketFactoryImpl.java:67) at com.sap.engine.services.wssec.srt.protocols.GetAssertionTicketPrivAction.run(GetAssertionTicketPrivAction.java:36) at com.sap.engine.services.wssec.srt.protocols.GetAssertionTicketPrivAction.run(GetAssertionTicketPrivAction.java:20) at java.security.AccessController.doPrivileged(Native Method)...
I think it is working from WSNavigator/EJBExplorer because there I'm logged in and Logon Ticket is generated and sent to server A, but because server C communicate with server B via REST(jsonp ajax call), there is no generated Logon Ticket on server B.
Is there a way to generate a Logon ticket or set credentials to the web service. I tried the following but its not working:
ZCUUTLI0016BPMTYPEDOWNL test = downloadService.getZCUUTLI0016_BPM_TYPE_DOWNL();
Mapreq_ctx = ((BindingProvider)test).getRequestContext();
Map> headers = new HashMap>();
headers.put("Username", Collections.singletonList("user"));
headers.put("Password", Collections.singletonList("password"));
req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
Note: Other possible solutions are also welcome.
Thanks,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ivan,
Please have a look of the below's J2EE part
SAP Logon Ticket - Wikipedia, the free encyclopedia
Thanks,
Hamendra
hi ivan,
for your scenario - does the abap backend call require a real user or is a technical user sufficient? if only a technical user is required you can define one in the single service administration/ application communication configuration of your portal System.
in order to use the logon ticket of your ajax call i think you need to configure/setup the correct sso - environment. checkout this link
regards,
christian
Hi Christian,
the abap backend call should use the real user credentials.
The problem with communication is between the java system and the abap. (The exception above appears when the java calls the abap web service).
With jsonp the cross domain issue between java system and SAP Gateway is resolved.
And I'm still trying to find out if there is an option to assing Logon ticket to the WSDL call in the java.
BR,
Ivan
User | Count |
---|---|
91 | |
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.