Skip to Content
Author's profile photo Jamie Cawley

Using the SAP Cloud Platform UserAPI in Mobile Services Development & Operations


The SAP Cloud Platform UserAPI provides a service which can be used to access details of the logged in user.  The details of this service can be found at

This service is available to html5 applications running on the Cloud Platform.  For an example of utilizing it in a html5 application see

Using the SAP HCP User API in SAP Web IDE

To utilize this service in a Mobile Services application we can perform the following

STEP 1: Create HTML5 App

To utilize this service in Mobile Services we first need to create an html5 app that exposes access to the service.  The only requirement for this app is to have a route defined in it’s neo-app.json for the userapi service.  You can either follow the above mentioned blog, add to any existing app running on the Cloud Platform or create a new UI5 app in Web IDE and add the following entry in the neo-app.json

  "path": "/services/userapi", 
    "target": { 
       "type": "service", 
       "name": "userapi" 

After making the change deploy the app to the Cloud Platform.  This can be done in Web IDE by right clicking on the app and choosing Deploy -> Deploy to SAP Cloud Platform.  In my case I have provided the app name userapi.

STEP 2: Add connection in Mobile Services Development & Operations

In Mobile Service for Development and Operations choose the menu option Connections.  Add a new connection that points to your app with /services/userapi appended to the url as shown

Set the SSO Mechanism to Application To Application SSO

Add this connection to the desired application by choosing the tab Back End of the desired application and adding the connection to the Application Connections section

STEP 3: Finalize/Test Mobile Services Application

This scenario requires that you are using SAML authentication for the Mobile Services application.  This can be done by setting the Security Configuration property, found under the Information tab, of the app to Form.  For more information regarding the use of SAML with Kapsel application see

You should now be able to use this connection within your Kapsel app.  An example of accessing the CurrentUser would be as follows.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hey Jamie,

      We have a unique workflow.  One where we use an edmx file from our real on-premise ODATA in WebIDE in order to build the application.  Once finished, we import the archive into our local machines and aim to change the application to the ODATA backend in Java EE.

      My question is how does one feed this WebIDE derived applications the serviceURL?  It seems there is no guide for this in specific.  I was hoping you could shed some light on it.

      As you know some clients just won't allow cloud connector or WebIDE local Installation. Thank you.

      Author's profile photo Jamie Cawley
      Jamie Cawley
      Blog Post Author

      Hi Shashank,

      Can you please create a new post in the Questions and Answers marked with the appropriates tags for you inquiry?



      Author's profile photo Former Member
      Former Member

      I already have sir.  Thank you for your response. We really require a solution.

      Author's profile photo Luca Motta
      Luca Motta

      Hi Jamie,

      I’m working with a NO-trial HCPMS. My back-end url is This URL from chrome works.

      On HCPMS destination creation wizard on SAML2 Audience field, the value is cutted, it doesn’t enter entirely. I try just with:

      But the calling throw ajax on my mobile app doesn’t work. My ajax:

      $.get("").done(function(results) {
        alert("success" + data);

      I receive this HTML response by SAML IDP:

      <p><script language="javascript">document.write("Please wait ...");</script></p>
       <p>Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.</p>
      <form method="post" action=""><input type="hidden" name="SAMLRequest" value="PEF1dGhuUmVxdWVzdCB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpuczI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOm5zMz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6bnM0PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIEFzc2VydGlvbkNvbnN1bWVyU2VydmljZVVSTD0iaHR0cHM6Ly9tb2JpbGUtYTM1NWU5ZThkLmRpc3BhdGNoZXIuaGFuYS5vbmRlbWFuZC5jb20vdXNlcmFwaS9jdXJyZW50VXNlciIgRGVzdGl.....+"/><input type="hidden" name="RelayState" value="oucrsjoxphifayttvbfrejmrg"/><noscript><input type="submit" value="Continue"/></noscript>

      Could you help me please?





      Author's profile photo Jamie Cawley
      Jamie Cawley
      Blog Post Author

      Can you please create a new post in the Questions and Answers marked with the appropriates tags for you inquiry?




      Author's profile photo Ajay Gupta
      Ajay Gupta

      Hello Luca,

      It would be great if could please share how was it resolved.
      I am facing the same issue.


      Author's profile photo Greg Carino
      Greg Carino

      Hi Jamie,


      Thanks for the very useful blog.

      Would you know how to consume the same API using the SCP iOS SDK?