1
votes

We got this error message when using WL.Client.connect API We got access denied in the following

The server error logs:

[ERROR ] FWLSE0020E: Ajax request exception: Cannot find application environment, application=test, version=1.0, environment=iphone [project WLTestConnect]

[ERROR ] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request [project WLTestConnect]Cannot find application environment, application=test, version=1.0, environment=iphone, User Identity {wl_antiXSRFRealm=null, wl_authenticityRealm=null, wl_directUpdateRealm=null, wl_remoteDisableRealm=null, SampleAppRealm=null, wl_deviceNoProvisioningRealm=null, SubscribeServlet=null, wl_anonymousUserRealm=null, wl_deviceAutoProvisioningRealm=null}. [project WLTestConnect] com.worklight.common.log.filters.ErrorFilter

[ERROR ] FWLSE0335E: Authorization failed: ClientId f5ac9a8cda443cfca33d1e7f926a71f90f8c67a1 was not found on the server. [project WLTestConnect]

Here's the scenario:

  1. Create Hello MobileFirst project in workspace A.
  2. Deploy the project to local MobileFirst Server in workspace A.
  3. Deploy Hello MobileFirst App to iphone and then use WL.Client.connect API. We got connect success callback.
  4. Export this MobileFirst project which named WLTestConnect.
  5. The iPhone device(iOS 10.2.1) still running.
  6. Switching to the new Workspace B.
  7. Import WLTestConnect project to Workspace B.
  8. Deploy WLTestConnect project to local MobileFirst server.
  9. Use WL.Client.connect in iPhone device and we got the access denied error.

MobileFirst version : 7.1.0.00-20151214-1857 & 7.1.0.00-20170608-1107

Is there a way to avoid access denied?

2
please delete the previously installed copy of App on the device, before the second one is tried on.krckumar
We have same problem in production env. it's hard to tell our client to delete preious one app an reinstall. Is it possible to use any code to avoid this?DannyYang
Questions: 1) What DB ? In both workspaces is it pointing to the same DB or different? 2) In step 9 is it the same device or new?Vivin K
It should be different DB, Step 9 is same device connect to same IP but different instance(workspace)DannyYang

2 Answers

1
votes

We have found a workaround for the problem:

set worklight.properties file

  1. mfp.session.independent=false
  2. comment the "#mfp.attrStore.type=database"

then connect success!

0
votes

This is a very valid error message and expected behaviour. When you move from one workspace in MobileFirst Studio to another, it creates a fresh copy of the MobileFirst server and the DB that holds the data for this server.

The app attempts to connect to the 'new' server and the error message essentially says that the server doesn't recognize this device because its DB doesn't have any history of this device connecting to it.