Pranab Agarwal
Pranab Agarwal

Reputation: 67

isCustomResponse() API - Available or not MFPF8

I have been trying to use isCustomResponse() API to grab the responses back from the network. I need to test the responses before I can make decision on what I need to do next in my Cordova app.

I had earlier asked a similar question before @ submitLoginForm() does not send the data to the authentication server - MobileFirst Cordova client

and it was informed that isCustomResponse() API is no longer available in MFPF8. When I look at the API list on MFPF8 online help here: https://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WL.Client.AbstractChallengeHandler.html

the API is one of the available APIs. Can someone please confirm whether this API is available or not. If it is not available, then I guess the online documentation requires an update.

Further, if this API is not available, can you please let us know as to why is this being removed from MFPF8?

Thanks.

Upvotes: 0

Views: 52

Answers (1)

Nathan H
Nathan H

Reputation: 49421

In Foundation 8.0, in most cases your security is implemented as a Security Check. When using a security check, the API isCustomResponse is no longer relevant: the framework will check the name of the security check to determine whether to activate the challenge handler. These types of challenge handlers are called SecurityCheckChallengeHandler.

There is one special scenario where you may still be interested in isCustomResponse: if your security is implemented by a third party gateway, such as DataPower.

In such a case, you need to use a different type of challenge handler, called GatewayChallengeHandler. In JavaScript they are created using the API WL.Client.createGatewayChallengeHandler (see documentation: http://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WL.Client.html#createGatewayChallengeHandler).

There you can use the old APIs such as isCustomResponse and submitLoginForm.

EDIT: With 8.0 GA, isCustomResponse has been renamed canHandleResponse.

Important notes:

  • There is a known issue in 8.0 beta that may prevent "gateway" challenge handlers to be triggered in some cases. This should be fixed when the release of the 8.0 GA version. Fixed.
  • The names of these challenge handlers and APIs are scheduled to change upon GA, so keep an eye out for this. Done, see this blog post: https://mobilefirstplatform.ibmcloud.com/blog/2016/06/22/challenge-handlers/
  • The API documentation will be updated with the release of GA as well. Done.

Upvotes: 1

Related Questions