jeudi 23 octobre 2014

Worklight security settings for a backend (second in chain) adapter


Vote count:

0




I have a Worklight app that I slightly customize for every client. I also more or less rewrite the adapter code for every client. Now I decided to split the adapter into two: one containing general features every client uses (login, messaging etc.) and another containing implementation details that may differ per customer.


The setup is as follows:



  1. The app calls the main adapter (ProjectAdapter), e.g. login procedure.

  2. The login procedure performs normal login, calls WL.Server.setActiveUser.

  3. The login procedure calls (WL.Server.invokeProcedure) the custom adapter to complement the login response with custom data.

  4. The login procedure returns the complete result object to the app.


However, I get into troubles trying to set up security for the custom (second in chain) adapter. If I set it to the normal security test I use in the app, it fails with:



[ERROR ] FWLSE0059E: Login into realm 'WLRemoteDisableNullLoginModule' failed. null. [project Project]
[ERROR ] FWLSE0117E: Error code: 4, error description: AUTHENTICATION_ERROR, error message: An error occurred while performing authentication using loginModule WLRemoteDisableNullLoginModule, User Identity {wl_directUpdateRealm=null, wl_authenticityRealm=null, Project=(name:1, loginModule:ProjectLoginModule), wl_remoteDisableRealm=null, SampleAppRealm=null, wl_antiXSRFRealm=null, wl_deviceAutoProvisioningRealm=null, WorklightConsole=null, wl_deviceNoProvisioningRealm=null, myserver=(name:1, loginModule:ProjectLoginModule), wl_anonymousUserRealm=null}. [project Project] [project Project]


It seems like setting the user identity with WL.Server.setActiveUser doesn't help. I also experienced this if I did WL.Server.getUserIdentity right afterwards, it would return undefined; not sure if this is supposed to be so.


I have to set the second-in-chain adapter security test to wl_unprotected in order for it to work.


How should I go about this?


Worklight version 6.2.0.00-20140922-2259.



asked 2 mins ago







Worklight security settings for a backend (second in chain) adapter

Aucun commentaire:

Enregistrer un commentaire