DannyYang
DannyYang

Reputation: 147

MobileFirst 7.1 Server Access Denied when using WL.Client.connect API

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?

Upvotes: 1

Views: 514

Answers (2)

DannyYang
DannyYang

Reputation: 147

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!

Upvotes: 1

Srik
Srik

Reputation: 7957

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.

Upvotes: 0

Related Questions