Skip to Content
0

Persist registration details for SAML Authentication without using MAF Logon UI

Feb 23 at 06:02 AM

17

avatar image
Former Member

Hi

I have successfully completed the SAML registration of user using the LogonCore APIs. Below is my code for the same

lgCtx.setHost(getString(R.string.SERVER_URL));
//Set portlgCtx.setPort(443);
//Set whether the registration uses secure connection or not lgCtx.setHttps(true);
lgCtx.setSecurtityConfig("default");
lgCtx.setDomain("default");
lgCtx.setChannel(LogonCore.Channel.REST);

HttpConversationManager manager = new HttpConversationManager(this);
        CommonAuthFlowsConfigurator configurator = new CommonAuthFlowsConfigurator(this);


// SAML Authconfigurator.supportSaml2AuthUsing(new SAML2ConfigProvider() {
@Overridepublic SAML2Config onSAML2Challenge(IReceiveEvent iReceiveEvent) {
return new SAML2Config("com.sap.cloud.security.login",
"https://"+(getResources().getString(R.string.DESTINATION_SAML) + "/SAMLAuthLauncher"),
"finishEndpointParam");
}
});


configurator.configure(manager);


LogonCore.getInstance().setLogonCoreConversationManager(manager);


//Register user*/
lgCore.register(lgCtx);
On registration finished I open the store using the app passcode and persist the registration data using the below code
 LogonCore  logonCore = LogonCore.getInstance();

                        try {
                            if (!logonCore.isStoreAvailable()) {
                                logonCore.createStore(sAuthPin, true);
                                if (!logonCore.isStoreOpen())
                                    logonCore.unlockStore(sAuthPin);
                                   logonCore.persistRegistration();
                            }
                            else{
                                if (!logonCore.isStoreOpen())
                                    logonCore.unlockStore(sAuthPin);
                            }


                        } catch (LogonCoreException e) {
                            e.printStackTrace();
                        }

I can successfully open the OnlineOdataStore for the first time. But the next time I try opening the store, my application hangs and I do not get any response. 
Is there a different way of persisting registration data for a SAML registration? Please help
 


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

0 Answers