cancel
Showing results for 
Search instead for 
Did you mean: 

Web service Logon ticket

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member193379
Active Contributor
0 Kudos

Hi Ivan,

Please have a look if it helps.

Thanks,

Hamendra

Former Member
0 Kudos

Hi Hamendra,

Thanks, but my problem is how to set the Logon ticket to the service which I'm calling in Java. Or to make the server to use automatically the Logon ticket which recieves from the Ajax call.

Greetings,

Ivan

former_member193379
Active Contributor
0 Kudos

Hi Ivan,

Please have a look of the below's J2EE part

SAP Logon Ticket - Wikipedia, the free encyclopedia

Thanks,

Hamendra

christian_santej
Active Participant
0 Kudos

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

http://help.sap.com/saphelp_nw74/helpdata/en/7a/9ad1882c244de0a3a99c1e46095ab3/content.htm?frameset=...

regards,

christian

Former Member
0 Kudos

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