Sriram B
Sriram B

Reputation: 691

IBM WL.Client.getUserInfo - Discontinued in v8.0 - What's the replacement?

I am using IBM MFP in my code and my current assignment involves migrating a project from MFP version v6.3 (Called as WorkLight) to Mobile First Platform v8.0.

During the migration process, the following Client API methods are considered as discontinued in v8.0. When I looked at IBM support site, it is told "No replacement". There is no more detail given on this. The methods are,

Does any one know what exactly this term "No replacement" mean? Does it mean the equivalent code has to be manually written by the developer who previously used WL.Client.getUserInfo?

This is the same case for other client API methods WL.Client.updateUserInfo & WL.Client.isUserAuthenticated?

Please help. I have gone through the IBM support knowledge centre, I don't see any page that gives a detailed explanation of "No replacement".

https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.upgrade.doc/devref/c_sdk_changes4migration.html

Upvotes: 1

Views: 213

Answers (2)

DannyYang
DannyYang

Reputation: 147

We follow this tutorial .

When user login success, then userLoginChallengeHandler.handleSuccess will pass the userInfo enter image description here

We just store this data(with expire time) to LocalStorage or filesystem.

You need to implement userInfo CRUD API for use by your APP.

For example:

WL.Client.isUserAuthenticated == userInfo is not empty and not expire

WL.Client.getUserInfo == return userInfo

WL.Client.updateUserInfo == modify the userInfo and save to your local

When a user logout, immediately invalidate the userInfo.

Upvotes: 0

Vittal Pai
Vittal Pai

Reputation: 3583

The following API's are discontinued in MFP Version 8.0 and there is no replacement/equivalent API's for these.

  • WL.Client.getUserInfo
  • WL.Client.updateUserInfo
  • WL.Client.isUserAuthenticated

The following are the workarounds where you can achieve same behavior of these API's.

WL.Client.getUserInfo - User information can be obtained in onSuccess callback of SecurityCheck Challenge Handler soon after authentication process else in response callback of Login API for UserAuthentication Security Check. You can write logic to store it locally in application and use it whenever it is required.

WL.Client.updateUserInfo - Do Logout from UserAuthentication security check and Re-login with new user information.

WL.Client.isUserAuthenticated - Implement the timer functionality in onSuccess callback of SecurityCheck Challenge Handler for UserAuthentication Security Check, which should start at onSuccess callback & Set the time of timer equal to the expiration time of access token. In application if you want to check whether user is authenticated or not, You can check the timer object, if it is expired - This means access token is expired else user is still authenticated.

and also you can request these API's support for MobileFirst Platform version 8.0 here.

Upvotes: 0

Related Questions