Skip to Content
Author's profile photo Rakshit Doshi

Onboarding users with Native OData SDK – SMP 3.0

Dear All,

From SMP 3.0 onward we have two ways for registering a user with SMP Server.

1. MAF Logon

2. Using OData SDK

A lot of people go for using the MAF Logon. MAF Logon comes with a pre defined UI Screen for Logon functionality so the developers do not need to do anything to onboard users. They can just import the MAF projects inside their IDE (Android Studio/Eclipse for Android)/ Xcode for iOS and just run the application.

You can learn how to onboard users using MAF Logon from this link

But there could be a requirement that you do not want to use the SAP Standard screen and have your own custom login screen, to maintain UI consistency all over the application. For this we can onboard users using OData SDK. The tutorial on how to onboard users using OData SDK can be accessed using this link

You might run into difficulties to authenticate users against any sort of Authentication mechanism that you use like HTTP/HTTPS etc but with NoAuthenticationLoginModule it will onboard your user but when you login to the Management Cockpit it will show the user registered as no_sec_identity.

Follow the below set of code to successfully onboard your user against an authentication mechanism that you have configured against your application id

Assuming that you have your own custom screen with a field for username and password and a Login Button you can add this set of code on the button click event of your Login Button

private LogonCore logonCore;  Define this as a global parameter at the start of your activity.

And within the button click event add this line of code

LogonCoreContext context = logonCore.getLogonContext();



context.setHost(smpHost);  //address of your SMP Server or relay server

context.setPort(smpPort);    // port of the SMP Server or port 80 if you are using the relay server

context.setHttps(false);       // Set to TRUE if you are using https

context.setFarmId(“0”);     //Set the FARM ID in case you are using the Relay Server


context.setResourcePath(“ias_relay_server/client/rs_client.dll);   //User this if you are using the Relay Server

context.setBackendUser(smpUserId);               //The field that the user will input his username

context.setBackendPassword(smpPassword);   // The field that user will input his credentials



context.setChannel(Channel.REST);               //This is a very important parameter to add else you would not be able to pass these parameters



With this you can see your user is authenticated against the security provider and now you can use all functionalities like SSO, Role Mapping etc relevant to your security provider.

These are all with inputs from Claudia Pacheco Pavel Penaz Prashanth Sutram

Hope this helps you all and saves all of your time to debug the error.



Rakshit Doshi

Assigned Tags

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

      Excellent, many thanks for sharing Rakshit, really appreciated!

      Kind regards,


      Author's profile photo Midhun VP
      Midhun VP

      Hi Rakshit,

      Thanks for the write up. Could you please mention the version of the server and sdk you used in your blog, because I have followed the blog you mentioned How To... On-board users with SMP 3.0 OData SDK (Android) and I am able to login using HTTP/HTTPS and LDAP authentication login module without changing the code that you mentioned. That means this code change may be needed only in the version you used.

      I am on SMP runtime SP06 and SMP SDK SP07.

      Regards, Midhun

      SAP Technology RIG

      Author's profile photo Timothy Li
      Timothy Li

      please use following simplest code to test the OData Onboarding:






      import com.sybase.persistence.DataVault.DVPasswordPolicy;

      import android.os.Bundle;


      import android.util.Log;

      public class LogonActivity extends Activity implements LogonCoreListener{

          private static final String TAG = "timothy";

          private boolean isHttpsEnabled = false;

          private String appConnId;

          private LogonCore logonCore;


          protected void onCreate(Bundle savedInstanceState) {






          private void initLogonCore() {

              logonCore = LogonCore.getInstance();

              logonCore.init(this, "");



          private void registerDevice() {

              Log.i(TAG, "appConnId:" + appConnId);

              LogonCoreContext logonCoreContext = logonCore.getLogonContext();

              logonCoreContext.setHost("10.***.***.47"); //please input the correct IP address here

              int port = 8080;



              UserCreationPolicy ucPolicy = UserCreationPolicy.automatic;



              try {

                  logonCoreContext.setBackendUser("smpAdmin"); // please note: here we input SMP cockpit logon username, NOT backend username

                  logonCoreContext.setBackendPassword("s3****in"); // please note: here we input SMP cockpit logon pwd, NOT backend pwd

              } catch (LogonCoreException e) {

                  Log.e(TAG, "error entering user credentials", e);





              Log.i(TAG, "after register");



          public void applicationSettingsUpdated() {



          public void backendPasswordChanged(boolean arg0) {



          public void deregistrationFinished(boolean arg0) {



          public void registrationFinished(boolean success, String message, int errorCode,

                  DVPasswordPolicy arg3) {

              Log.i(TAG, "registrationFinished, success? " + success); //If you get “success” in console output, go to cockpit/applictions/click on your application id, you will see if a new registration already created!

              Log.i(TAG, "registrationFinished, message= " + message);

              Log.i(TAG, "registrationFinished, errorCode= " + errorCode);



          public void traceUploaded() {



      Author's profile photo Wissal Dibej
      Wissal Dibej

      hi i have a problem when i try to access data from offline store when the devise is offline could you plz help me