Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:17:06+00:00 2026-06-15T11:17:06+00:00

I need to access an api which requires http authentification on a per user

  • 0

I need to access an api which requires http authentification on a per user basis using a jquery mobile api.

I plan to make the app available as a website as well as packaging it in Cordova for various devices.

If I have a login form which captures the username and password and store this as a javascript variable, is there any way this data could be exposed?

If so, what’s the best alternative to handle storing the users authentification details? I am reticent to build an intermediary server if I don’t have to.

Many Thanks. 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:17:07+00:00Added an answer on June 15, 2026 at 11:17 am

    I would suggest not storing the username or password in the localStorage, but instead to store an access token. Access tokens can be updated and changed frequently, it also doesn’t reveal who the user is or what their hashed password is.

    Besides iOS Keychain or if you’re coding it for a non-iPhone device for added security you can:

    • Change the access token at each login and each time the app is used
    • Store the device ID in the server database (see http://docs.phonegap.com/en/2.2.0/cordova_device_device.md.html#device.uuid)
    • Clear the localStorage and request a new login if the access token or device ID doesn’t match the data stored in the database

    Make sure you don’t store the device ID in the localStorage.

    For added security you can also store the user’s IP address in the database and check (server side) if the IP address matches, but this might too much since the user would have to login every time they connect to the internet in a new location or if their IP address changes.

    Storing the IP address in the server database then checking if it matches (server side) would probably be the safest since it wouldn’t matter if someone got hold of the localStorage data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a service which will need to access a certain Big Corp API
I am designing a web API which requires fast read only access to a
I need my app to be able access an third party API who limits
I am writing a android application which requires dependency injection in the data access
i want to uses youtube's api within rails. I need a client which is
Goal: Allow a user to authentication with Facebook into an iOS application which requires
I need to access some web api from my desktop application for authentication. For
I have implemented REST API using PHP. This API access to MySQL Database. I
I am writing a small library, and in which I need to access several
I want to implement a basic RESTful service using Tomcat. The API requires authorisation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.