Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

XHR authorization

Hi,

Are you storing login and password credentials on device (Titanium.App.Properties) to prevent need of loggining each time application starts?

— asked November 18th 2010 by Przemyslaw Kopec
  • authorization
  • xhr
3 Comments
  • Could you clarify what you mean by "ary"?

    — commented November 18th 2010 by Paul Dowsett
  • Please paste your code so far, to give us something to work with.

    — commented November 18th 2010 by Paul Dowsett
  • huh??

    — commented November 18th 2010 by Aaron Saunders

4 Answers

  • Accepted Answer

    It depends on how your server is set up, but you can't store authentication credentials in a persistent cookie, if that's what you're asking. If you want to avoid using oAuth (not a bad call), my suggestion would be to authenticate against your server once and have your service return a token to be used on subsequent service calls. That way you don't have to store a password on the device at all.

    — answered November 19th 2010 by Kevin Whinnery
    permalink
    0 Comments
  • Can I store user credentials on device once he signed in and use them on next application run to "auto sign" user and prevent showing login dialog? Is it safe (data stored on device is encrypted)?
    What is the way to do it without using OAuth.

    — answered November 18th 2010 by Przemyslaw Kopec
    permalink
    0 Comments
  • You dont need to.

    If you're using standard database setups, store the id of the user locally. Then when you go to the login page, if the id is set in the app properties, you dont have to login anymore, just redirect. If not, prompt them to login, then save the id.

    — answered November 18th 2010 by Josh Lewis
    permalink
    0 Comments
  • But session is stored on the server. What if someone intercepts method of authenticating user by id?

    — answered November 19th 2010 by Przemyslaw Kopec
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.