Search code examples
quickblox

Quickblox - Rermember app session via REST


I am using the REST version of the api in Appcelerator Titanium.

I am authenticating the app and then later authenticating the user with a username and password.

However, if I close the app the session is lost and the user needs to login again.

Is there any way around this, other than storing the users login / password in the app, which i don't really want to do?

Ideally I would like to renew the token and carry on...

I have seen this answer (check for valid user session) but it doesn't seem valid in my case as it is using the facebook id to login.

Thanks for any info


Solution

  • Expiration time for token is 2 hours after last query. If you will perform query with expired token - you will receive error Required session does not exist. In this case you have to recreate session.

    Also, each API response contains header QB-Token-ExpirationDate which contains Token expiration date.

    QuickBlox uses 2h for security reasons.

    At the moment only one way is to store login/pass in app

    There are lots of secure mechanisms to do such things, for example Apple iOS Keychain API https://developer.apple.com/library/ios/DOCUMENTATION/Security/Conceptual/keychainServConcepts/iPhoneTasks/iPhoneTasks.html