Hello,
I am testing Backendless for my android chat application. Suddenly all users of application got BackendlessFault{ code: ‘3064’, message: ‘Not existing user token - 15EB96DB-E051-F72F-FF87-872B5E329D00. Relogin user to update your user token’ } kind of error.
I am using bellow method to check the validity of user token. Same error seen in handleFault method without indicating validity as true or false.
Backendless.UserService.isValidLogin(new AsyncCallback<Boolean>() {
@Override
public void handleResponse(Boolean response) {
isLastLoginValid = response;
String userId = Backendless.UserService.loggedInUser();
Log.i(TAG, "Is login valid? - " + isLastLoginValid);
User.getInstance().setId(userId);
currentLoggedUser=User.getInstance();
}
@Override
public void handleFault(BackendlessFault fault) {
Log.e(TAG,fault.getMessage());
}
});
Can I know how can I test the validity of the user token?
Regards
Shan
Hi, Gihan!
The best way to check you login validity is to try to perform any API operation.
Do you encounter any errors while trying to relogin?
Hi, Anatolii,
No I haven’t encountered a problem while relogin.
But what is the purpose of Backendless.UserService.isValidLogin Method? Didn’t it check the login validity?
Regards
Shan
Hi Gihan
Session timeout may be expired due to inactivity timeout, if this setting was enabled in Users -> Login page
Otherwise, we need solid steps to reproduce for further investigation
Hi,
I have attached the Users → Login tab settings in my app.
I am getting this issue when same logged in user is trying to login from different device.
As I understood this is the reason for the issue. When user is trying to login from another device, the previous login session is expired by the backendless server. But the app in the previous device still contains the old token. When I am checking token validity using isValid() method, it returns “Not existing user token” fault. Am I correct?
My requirement is One user need to login only from one device. I have put that settings to user->login tab. But I don’t clear what is happening there.
Hi,
With setting from screenshot if second user is logged in, then first user is logged out by server and its token becomes invalid. If first user tries to use this token then the fault 3064 will be received. First user can re-login in this situation.
Hello,
Thank you very much for the clarification. I think now we came to correct path.
Issue is when I use Backendless.UserService.isValidLogin method, I am not getting RESPONSE as FALSE in handleRespose method for the first user. Instead the response is goes to handleFault method with error code 3064. Why is that?