- This topic has 6 replies, 3 voices, and was last updated 12 years, 10 months ago by
ClintNash.
-
AuthorPosts
-
ClintNashMemberI am submitting a login / password to a web service and getting back a GUID (authorization token with a short life), for all subsequent request rather than pass the login information to the web service, I will just pass the token.
The question that I have is how should I store that token. My first thought was to use local storage, however doing some research has raised questions about whether local storage (as of IOS 5.1) is working correctly / consistently. I though I should get some input before we code something that I have to replace later when it fails.
Thanks for you thoughts,
Clint…
support-octavioMemberHi ClintNash,
I’m discussing with dev team for best advice. Will follow up tomorrow.
ClintNashMemberFor the time being I have stored the token in Local Storage, however I wanted to do a quick follow up to see if there was advise from your development group on a better place to store it. Obviously this works just fine, however if it doesn’t work for all versions of IOS then I need a different approach.
Thanks,
Clint…
support-michaelKeymaster>however if it doesn’t work for all versions of IOS then I need a different approach.
Localstorage is available the iOS versions supported by MobiOne (iOS 3.1 – 5.1 (current))
Question: what is the lifespan and security requirements for the token?
For example if the token were deleted does the app simply request a new token?
ClintNashMemberWayne,
The implementation is fairly simple. Login screen passes user name / password to ssl web service which generates a GUID, stores it on the server (SQL Server) and returns it (the GUID) to the application as a token (string). All additional calls to web services pass the token as a parameter which is checked against the database to confirm that its valid. The server expires the tokens after 30 minutes and return a “failed to authenticate” back to the client which redirects back to the login screen. So in response to your question if the token is deleted or if the token has expired the user is redirected back to the login screen.
As a follow up question, I have been looking at the local DB options, is it possible to persist a table stored in a local DB for a native IOS app after the app is closed?
Thanks,
Clint…
support-octavioMemberHi ClintNash,
>I have been looking at the local DB options, is it possible to persist a table stored in a local DB for a native IOS app after the app is closed?
I’m not sure I get your question exactly. Is your question will data stored in an app’s local storage db be avail after your app is terminated? If yes, the answer is yes, your data will be avail when you restart your app. If I’m getting this wrong please restate your question with more detail or a timeline of events that affect your app’s data persistence.
ClintNashMemberActually that answers the question. I was a little confused based on other post that I have read as to whether data stored in the local storage DB would be available each time the application is started or if it was collapsed (deleted) on application close and initialized each time the application was started. Thanks for the response that actually solves another problem.
Clint…
-
AuthorPosts