Skip to Content

How to on-board user with HANA Cloud Platform mobile services

I was excited to hear the announcement about HANA Cloud Platform mobile services trial availability. This is a great opportunity to the developer community to try the/wp-content/uploads/2014/12/hcpms1_612219.png solution for free. HCPms is the cloud version of SAP Mobile Platform. SAP had another cloud version of SMP called SAP Mobile Platform, enterprise edition, cloud version it was deprecated.

Even there are few differences between SMP on-premise (SMP 3) and HCPms the mobile SDK is common for both, ie. an app written for SMP 3 runs against HCPms too without any code change – that caught my attention. Here I am going to run one of my existing hybrid mobile app developed for SMP 3 against HCPms.


Activate HCPms

Apache Ant should be installed and added to path

Android SDK – It also requires Java


Cordova – Version is 3.6.3-0.2.13



Configure Application in HCPms

From the HCPms admin cockpit (https://hcpmsadmin-<your HANA account user name> click on Applications> Click on Add icon on the bottom bar and provide below details:

Application ID : com.kapsel.logon

Name: com.kapsel.logon

Type: Hybrid

Security Configuration : Basic

Optionally provide Description and Vendor.

ScreenHunter_16 Dec. 19 11.24.jpg

Click on Save.

Next, click on Backend and provide the below details.

Backend URL :

Authentication Type: No Authentication

ScreenHunter_18 Jan. 03 20.42.jpg

Save the configuration.

Develop Hybrid Mobile App

Follow this blog to develop a kapsel logon based hybrid app. Replace index.html with index.html. Only change needed to run the app with HCPms is providing the HCPms host and port.

Run cordova command:

cordova prepare

Connect phone with PC using USB and execute the cordova command:

cordova run android to run the app in the device.

Offline a Demo

Adding offline functionality to a hybrid app is quite easy using Kapsel plugins. Following the blog Getting Started with Kapsel Offline OData I have added the offline plugin to the app for a small demo.

  • Download datajs file and place it in www folder
  • Replace index.html with index.html
  • Execute below commands from the project path to add the offline plugin.

          cordova -d plugin add

          cordova plugin add

ScreenHunter_18 Jan. 03 19.43.jpg

Happy Coding !

Midhun VP

You must be Logged on to comment or reply to a post.
  • Dear Midhun VP,

    thank you for the walk through. I followed your steps and was able to register the app I've built using you sample. I thought I had to publish my app, but the publish failed with an error. So now let's try the next step and call a OData service. Have you already tried to use the OData off-line functionality?

    Best regards


    • Hi Gregor,

      I just added the code for Odata offline. Hope that helps.

      Regards, Midhun

      SAP Customer Experience Group - CEG

    • HI Gregor,

      The "publish" button, exposes the App configuration to Mobile Secure (if you have connected your Mobile Secure Account to HCPms) and let you create Apps, which are able to retrieve the inial HCPms URL from mobile secure, resulting in an Application start where the user does not have to put it any configuration. He just logs on and uses the app.


        • Hi Gregor,

          yes, in the sense that the Discovery Service is working in the Trial - as I mentioned in my blog, there is almost no technical limitation.

          Anyhow, you need a separate Mobile Secure trial.

          Both systems needs to exchange some "secrets" in order to communicate. This is described in the documentation.


  • Hello Midhun,

    Thank you very much for the update.

    • I have been working on SMP. I built a mobile App, using UI5, Cordova & offline (using kapsel secure storage + cordova network detection abilities) support with SMP3 SP3 - cloud version. In the experiment I used HCC to connect to on-premise backend.  As I understand, from your blog, I will not need to do any changes in my code to make it run with HCPms. Am I right? Or are there going to be considerations to be made, while moving to HCPms?
    • Further, what I am not very clear about (and so would like to request information  about) is the difference between "SMP3 - cloud version" and  "the new HCPms".

              Quoting you - "HCPms is the cloud version of SAP Mobile Platform. SAP had another           cloud version of SMP called SAP Mobile Platform, enterprise edition, cloud version it           was deprecated."

              So what are the new capabilities (and/or deprecated capabilities like SMS services,           perhaps) that come with HCPms. Could you please guide me to some knowledge           source?

    Thanks in advance!


    Utsav Chobe

  • Hi Midhun VP,

    thanks for this content. Now I have to find a new topic for my upcoming document.

    This was exactly what I wanted to demonstrate next.




  • Thanks for sharing, we are just moving to HCPms and learning the mechanism of HCPms.

    I'm looking forward to read more from you.


    Thanks and regards.

    Patton Li.

  • Hi Midhun,

    Thanks a lot for the blog. It's very useful.

    I've followed you example for offline app connect to HCPms. It was working fine on the first run last week but when I tried it again today, it return an error


    An error occurred "[-10204] Communication with the server failed with status code: 500""

    Do you have any clue if this is an issue on the server side or it's something to fix on the js code?

    • Hi Thanit,

      As "HTTP 500" corresponds to "Internal server error". There might be few reasons for this error.. e.g. something web wrong on server side but server cant give more specific info on what the exact problem is.

      I guess, you should create a new discussion at SMP Developer Center   > start a discussion

      and share the steps you followed with screenshots.



  • Hi Midhun,

    In your blog you said at this section:

    Develop Hybrid Mobile App

    Follow this blog to develop a kapsel logon based hybrid app. Replace index.html with index.html.

    The link for index.html isnt working for me. Would you mind sending me the contents of the file or checking the link?

    Thank you

    • Hi Jared,

      The link is working, I just checked.

      Since it's not working for you I am pasting it here:



              <script type="text/javascript" charset="utf-8" src="cordova.js"></script>


                  applicationContext = null;


                  window.onerror = onError;

                  function onError(msg, url, line) {

                      var idx = url.lastIndexOf("/");

                      var file = "unknown";

                      if (idx > -1) {

                          file = url.substring(idx + 1);


                      alert("An error occurred in " + file + " (at line # " + line + "): " + msg);

                      return false; //suppressErrorAlert;


                  function logonSuccessCallback(result) {

                      alert("Successfully Registered");

                      applicationContext = result;



                  function logonUnregisterSuccessCallback(result) {

                      alert("Successfully Unregistered");

                      applicationContext = null;

                      //sap.Logon.unlock(function () {},function (error) {});



                  function register() {

                      if (applicationContext) {

                          alert("Already Registered");



                      var appId = "com.kapsel.logon"; // Change this to app id on server


                      // Optional initial connection context

                      var context = {

                          "serverHost": "", // HCPms host name

                          "https": "true",

                          "serverPort": "443",

                          "user": "P1000000",// HCPms admin user/ SCN User

                          "password": "welcome123", // HCPms admin password / SCN Password

                          "communicatorId": "REST",

                          "passcode": "password",

                          "unlockPasscode": "password",



                      sap.Logon.init(logonSuccessCallback, logonErrorCallback, appId, context);


                  function logonErrorCallback(error) {  

                      console.log("An error occurred:  " + JSON.stringify(error));

                      if (device.platform == "Android") { 







              <h1>HCPms Hybrid App</h1>

              <button id="register" onclick="register()">Register</button>



      Regards, Midhun

      SAP Technology RIG

  • Hi Midhun VPļ¼Œ

    Thanks for your sharing. I have created LogonDemo and used iOS simulator to register successfully.

    My question is how to configure my LogonDemo application in HCPms to use my on-premise LDAP Server as a cloud user store or or how to configure it by using kapsel deploy command. 

    I have already had cloud connector and configured it to use our LDAP AD. And, the destination/backend connection of onpremiseumconnector has been defined also.

    The reference is Configuring User Store in the Cloud Connector.(SAP HANA Cloud Platform). It gave an neo command for JAVA applications.

    Thanks for your help.

    Best Regards,


  • Hi Midhun,

    Thanks for the post!

    By pressing the button "Register" i got the error:

    sap is not defined, where calling the method sap.Logon.init .

    Any idea what my mistake is?



    • Hi Georgi,

      Could you double check whether you added the Logon plugin using the command cordova -d plugin add

      Regards, Midhun

      SAP Technology RIG

      • Hi Midhun,

        I've added the Logon plugin by typing: cordova -d plugin add C:\SAP\MobileSDK\KapselSDK\plugins\logon ,

        typing the cordova -d plugin add in the cmd got an Error: 404 Not found :

        Just checked by typing cordova plugins and got response : 3.5.0 "Logon"



        • Hi Georgie,

          You should be able to add the required kapsel plugins. Please follow this blog: Getting Started with Kapsel - Part 2 -- Logon and use replace the index.html wiith the one I given. Sorry the logon plugin command is cordova -d plugin add

          You are getting the above mentioned error because the required plugins are missing in your project.

          Regards, Midhun

          SAP Technology RIG

          • I've just added the odata plugin and its dependencies - corelibs and AuthProxy.

            But now I'm getting the error "cannot call method 'init' of undefined" of the same code line

          • Hi Midhun,

            - codova -d create D:\Path com.kapsel.logon KapselLogon

            - cordova platform add android

            - cordova -d plugin add D:\Path-to-logon-plugin"

            -cordova -d prepare

            - added the other plugins and its dependencies (odata, corelibs, authproxy)

            My app in the HCPms:


          • Hi Georgie,

            When you are creating project you have to mention the SMP SDK kapsel plugins path too.


            cordova -d create C:\Kapsel_Projects\LogonDemo com.mycompany.logon LogonDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"

            Regards, Midhun

            SAP Technology RIG

  • Hi Midhun,

    I have enabled my HCP Mobile server and configured an application in the Cockpit.

    I want to authenticate my username and password against the gateway username and password while onboarding.

    According to this document,, I found that I have to enable SCIM service if I want to authenticate with the backend while onboarding.

    Is it possible to enable SCIM service for trial account?

    If possible, then how to do that?

    Do I have follow some steps(like creating destination in Cloud Platform Cockpit) after enabling SCIM service?



      • Hi Gregor,

        Thanks for your reply.

        I will try with your project for authentication.

        I have already used the SAP Cloud Connector to connect to my on-premise backend.

        So do you mean to say that right now we cannot enable SCIM service for trial account?



        • I have the same question.

          I have an application in HCPms and SAP Cloud Connector already to

          a. exposing backend services, and

          b. having corporate LDAP as an user store

          For user authentication, should I enable SCIM service? And, how it could be implemented at mobile app side, via Client Hub and Kapsel Logon Plugin?

        • Hi Dhani,

          as you can use the Cloud Connector also for the Trial Landscape it's absolutely possible to use an SICF (That is the correct name of the transaction) Service.

          Best regards


  • Hi Midhun VP,

    Thank for your helpful description how to use HCPms together with mobile Kapsel applications.

    Together with two SCN blogs from Daniel Van Leeuwen ( and and your blog I managed finally to run the Logon Kapsel application on my android device and I registered a user on my Trial HCPms account by means of this app (using BASIC and NONE security types, both worked).

    But for my HCPms on landscape the user registration does not work with the same Kapsel Logon application when using BASIC security type configuration for the Kapsel Logon app in HCPms UI.

    The NONE security type configuration worked also on, i.e. in that case users could be registered.

    But I want to registered secured users which are connected to the account and the HCPms service by a SAML-configuration of an SAP Cloud IdP (SCI) which is connected already to my account.

    Do you have an idea what might be the reason why the BASIC secu type (I also tried FORM, i.e. SAML but failed as well) does not work in the described situation?

    Thank you very much for any help on this issue.

    Best regards,


    • Hi,

      I've just figured out that my Kapsel Logon App I mentioned in my last comment also works on my HCPms account with security type BASIC.

      What was my mistake?

      My HCPms account on is connected to SAP Cloud IdP (SCI), so I thought that the users which could register via the Logon Kapsel App are the users defined in the SCI.

      But this seems not to be the case by default: Still the SAP IdP (i.e. SCN users) is the relevant users store for registering authenticated users.

      I will ask a new question in the forum (see here) how to change my HCPms so that my SCI (and not SAP IdP) is taken as basis for users to be registered.

      Best regards,