Search code examples
ibm-mobilefirstjsonstore

Remember me functionality in IBM Worklight


We are using Worklight 6.1 for our app. I want the app to remember the user id (with no limitation on the duration & it should be accurate & reliable).I want to use JSONStore API for this purpose.

In our app, after we gather the user credentials, we are sending them to an adaptor function, where we are invoking some java classes to validate the credentials aginst IBM bluepages & also against dbs

I have two questions:

1) When i ensure that user has been authenticated successfully for the first time, I will open a JSON store & keep the userid to the local storage, If I choose to encrypt it , which password I need to supply to make it encrypted ?

2) When the user tries to access the app from the same mobile device, the server should send a login form by pre populating the user id, how do I do this?

Thanks..


Solution

  • Encrypted Offline Cache is deprecated, so you might as well use JSONStore.

    In MobileFirst Platform 6.3 ("Worklight"), there is a tutorial that accomplishes exactly your scenario. You should read it and try to implement it in 6.1; depending on JSONStore's featureset in 6.1, you might be able to. You'll need to try.

    Here it is: Offline Authentication