prevForm.show() error in Browser widget in identity service endpoint callback

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

Thank you

PFA the project files related to the issue and Error log

A gentle reminder

Hi,

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.

http://docs.kony.com/konylibrary/konyfabric/kony_fabric_user_guide/Default.htm#KonyStudio/Installing_KonyJS_SDK.htm#Loginoauth

Thanks,

Thank you

That worked for us

Regards

Dear

One more clarification please

We would like to know if there is anything else to be configured to read the response parameters from service response

We receive some token from response, but getting blank response in the success callback section

Thanks

Hi,

In Login success callback, please use below snippet.

authorizationClient.getBackendToken(false,{}, function(response) { alert("access token :" + JSON.stringify(response["params"]["access_token"])); }, function(error) { kony.print("Failed to fetch profile : " + JSON.stringify(error)); } );

Thanks,

Hi,

I was also getting same error. downloaded siritest1Export and it worked. This is really very useful. Thank you