This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.
Dear Team
We have out Identity service configured in the App. We are trying to call the service on click of a button. This is how it works in our sample app
When the Identity service with Authorization End-point is invoked, we are getting the browser window on which we enter the username and password. Once authentication checked we get response for Success or failure. Our sample app works fine and executes the code in respective callback functions,closes the browser widget popup and comes to the previous form which has the button.
When we integrate the same in our Project, after login in the browser windows, the app closes. none of the callback functions are reached a per logs. We see the following error Log
Error code 605
Error in Browser widget onPageStarted callback. kony_sdk.js:10657
prevForm.show();
Uncaught TypeError: prevForm.show is not a function
Attached is the sample app and our project code file which is using it
Please help us solve this. We would like to understand why it is closing our app and working in sample app
Provided sample app is Non MVC project and it redirects to the previous form, but your actual project is MVC project where we will not have any previous form reference to redirect so we have to pass the browser widget reference in login parameters.
The browserWidget field is mandatory for Kony Applications built by using the MVC architecture on Kony Visualizer.
Snippet:-
define({ //Type your controller code here invokeidenty:function() { var argument = {}; var authorizationClient = null; var sdkClient = new kony.sdk.getCurrentInstance(); if (Object.keys(sdkClient).length !== 0) { authorizationClient = sdkClient.getIdentityService("facebookidentity"); } if (authorizationClient === null || authorizationClient === undefined) { alert("Authorization object null - Connect to MF"); return; } this.view.forceLayout(); argument.browserWidget = this.view.brw1; authorizationClient.login(argument, function(response) { alert("Auth Login success:: " + JSON.stringify(response)); var ntf = new kony.mvc.Navigation("Form2"); ntf.navigate();}, function(error) { alert("Auth Login Failure:: " + JSON.stringify(error));}); } });
PFA sample MVC app for reference and below are the document links for reference.