Skip to Content
0

User Registration/OnBoarding failure using Odata Native Development

Apr 03 at 03:03 PM

26

avatar image

Hi

I am trying to on-board/register with given credentials .But I am getting below 404 error code with string as "HttpConversationManager$ConversationFlow$ReceiveEvent" and boolean condition as false on registrationFinished() method.

Please let me know if I am missing something in my end ?

 public class MainActivity extends AppCompatActivity implements LogonCoreListener {
    private final String TAG = MainActivity.class.getSimpleName();
    public static String Port, appId = "com.xx.xmoc", connID, secCon = "xMocSec"/*"SMNetworkEdge"*/, domain = "default";// SSO CERT
    public static String userName = "kbafqb"; //null;//"supuser";//"perfios";//"SUPUSER";
    public static String smpurl = "xxmobile.shellglobal.com";
    public static String password = "@sasha@123";
    LogonCore lgCore;

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        Button button = (Button) findViewById(R.id.testbutton);
        button.setOnClickListener(new View.OnClickListener() {


                                      @Override
                                      public void onClick(View view) {
                                          registerDevice();
                                      }
                                  }


        );
        initializeLogonCore();
    }


    /**
     * Initialize LogonCore component
     */
    private void initializeLogonCore() { //Get LogonCore instance
        lgCore = LogonCore.getInstance(); //Create a LogonCoreListener for asynchronously registration
        lgCore.setLogonCoreListener(this); //Initialize LogonCore with application configuraton name
        lgCore.init(this, "xxxMobile");
        try {//check if slgCore.init(this, ""); //Check if application connection existsecure store is available
            if (lgCore.isStoreAvailable()) {
                lgCore.unlockStore(null);
                String appConnId = lgCore.getObjectFromStore(appId);
            }
            if (lgCore.isRegistered()) {
                // send user to main activity
                Log.v("IsUserRegistered", "true");
            } else {
                // show login form
                Log.v("IsUserRegistered", "false");
            }


        } catch (LogonCoreException e) {
            Log.e(TAG, "error initializing logon core", e);
        }
    }
	
	 public void registerDevice() {
        try {
            LogonCoreContext context = lgCore.getLogonContext();
            context.setHost(smpurl);
            context.setPort(443);
            context.setHttps(true);
            context.setFarmId("xxx.ad.xx.msg");
            context.setSecurtityConfig("xMocSec");
            //context.setResourcePath("ias_relay_server/client/rs_client.dll");
            context.setDomain("default");


            // MOST important part!
            context.setChannel(LogonCore.Channel.REST);


            context.setBackendUser(userName);
            context.setBackendPassword(password);


            // call registration
            lgCore.register(context);
        } catch (LogonCoreException e) {
            e.printStackTrace();
        }
    }


and in the call back method,I am getting

 public void registrationFinished(boolean b, String s, int i, DataVault.DVPasswordPolicy dvPasswordPolicy) {
        Log.v("registrationFinished Successful", b);//as false
        Log.v("registrationFinished i  code", i);//as 404
        try{
	    if(b)
            	String endURl = lgCore.getAppSettings().getApplicationEndPointURL().toString();
        }catch (Exception e){
            Log.v("Exception in getting endpoint URL",e.getMessage());
        }


    }

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Attila Barus
Apr 04 at 01:52 PM
0

Hi Rakesh,

1,Can you please collect some Android device log(logcat) when you run the application and attach it ?
2,What Identity Provider is being used in this case ?
3,Have you come across KBA 2065300 - How to configure HttpConversationManager by MAF Logon Configurator ?
https://launchpad.support.sap.com/#/notes/2065300

Here you can find an example code snippet for your choice of platform be it Android,iOS or Windows.

All the best,
Attila


Share
10 |10000 characters needed characters left characters exceeded