ibm mobilefirst - Issue with Worklight authentication on Android and isUserAuthenticated -


i experiencing problem authentication within android application, using worklight version 5.0.6.

i have created secure app using authentication configuration:

<securitytests>     <mobilesecuritytest name="sencha22-mobile-securitytest">         <testdeviceid provisioningtype="none"/>         <testuser realm="sampleapprealm"/>     </mobilesecuritytest> </securitytests>  <realms>     <realm loginmodule="strongdummy" name="sampleapprealm">     <classname>com.worklight.core.auth.ext.formbasedauthenticator</classname>     </realm> </realms>  <loginmodules>     <loginmodule name="strongdummy">         <classname>com.worklight.core.auth.ext.nonvalidatingloginmodule</classname>     </loginmodule> </loginmodules> 

i have challengehandler following:

challengehandler.submitloginformcallback = function(response) { var isloginformresponse = challengehandler.iscustomresponse(response); if(isloginformresponse){     //login unsuccessful     ext.msg.alert('error', "login not successful", ext.emptyfn); }else{     //login successful, reload app     wl.client.reloadapp(); } } 

the wl.client.reloadapp() statement executing correctly after authentication occurs, function:

wl.client.isuserauthenticated("sampleapprealm") 

is returning null on android.

the application works fine when viewed common resources in chrome.

is there problem isuserauthenticated on android?

first of all, don't think reloading application after authentication idea. now. authentication information received wl server once application connects it. connect wl server need either set connectonstartup:true in initoptions.js or use wl.client.connect() api. since you're saying problem occurs on android guess have timing issue. make sure you're calling isuserauthenticated api after client has received response server.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -