psx February 2016

IBM Mobilefirst Javascript Client-side API WL.Client.isUserAuthenticated returns true even if session is expired

mfp version 7.1.0.00.20151227-1730
  • In login module set expirationInSeconds to 20 seconds.
  • Login and wait for 20 seconds.
  • Session expires.
  • When I try to access protected resources it responds correct (asks for authentication).
  • But..WL.Client.isUserAuthenticated("realmName") still returns true (!).

Seems that this function just returns cached boolean, and not true status.

How do I check real auth status?

Answers


Nathan H February 2016

When using WLResourceRequest you automatically use the new OAuth framework for authentication.

The WLClient APIs are not relevant in the OAuth flow. Instead, you should look at the WLAuthorizationManager APIs: http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WLAuthorizationManager.html

Post Status

Asked in February 2016
Viewed 1,668 times
Voted 11
Answered 1 times

Search




Leave an answer