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 8389083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:37:37+00:00 2026-06-09T18:37:37+00:00

I’m designing a web site that will have a mobile companion (initally iPhone only).

  • 0

I’m designing a web site that will have a mobile companion (initally iPhone only). The web site will be an ASP.Net MVC 3 application. I’ll also have an ASP.Net Web API site (MVC 4) to expose services to the iPhone application. The iPhone app will have its own form to capture username and password from the user and send that to the web API in JSON headers.

I want to consider security from the start rather than an after thought. I’m not a security expert by any means. I’ve done a good deal of research to see how other’s are handling authentication of a mobile application client from a web service. I think I’ve come up with a decent solution that doesn’t involve hooking into to third party oAuths.

I would greatly appreciate any and all opinions, advice, criticism and general WTFs that any of you can offer. 🙂

My biggest concerns are:

  1. Ensuring that calls made to the web API are authorized
  2. Minimizing the risk of replay attacks (hence timestamps in the calls below)

The iPhone app will be developed as such:
Two strings are hard-coded into the iPhone app (same values for every user):

  1. Application ID
    This is a string that is used to identify the type of client that is accessing the web API (iPhone, Android, Windows phone, etc).
  2. Application’s Hashing Salt
    This is a string that is used to salt hashes for user-agnostic requests.

Two strings are stored in the iPhone app’s local database (values unique to each user):

  1. API User Access Token
    This is a string (token) provided to the client by the web API upon successful authentication and allows the client to access the web API without sending the username and password in each request.
  2. User’s Hashing Salt
    This is a string that is used to salt hashes for requests made against established user accounts.

The iPhone will make calls to the web API in the following manner:

API Method: Create Account
Client Sends:

  • New Account Data (Username, Password, First Name, Last Name, etc..)
  • Application ID
  • UTC Timestamp
  • Hash of UTC Timestamp + Application ID salted with Application’s Hashing Salt

API Returns:

  • New User’s Hashing Salt

    The idea here is that, when creating an account, I can use the application’s hardcoded salt since it’s not a huge security risk if that salt ever got out (through decompilation or some other means).

    But for methods that access and modify the user’s data I’ll use a salt that is owned only by that user so it can’t be used by an attacker to impersonate others.

API Method: Get Account
(Used for getting user’s hashing salt for accounts that were created on the web site but haven’t yet been synced on the iPhone. This happens when a user tries to log in on the iPhone and iPhone detects that it has no record for that username.)

Client Sends:

  • Username
  • Password (hashed with Application’s Hashing Salt)
  • Application ID
  • UTC Timestamp
  • Hash of UTC Timestamp + Application ID salted with Application’s Hashing Salt

API Returns:

  • Existing User’s Hashing Salt

API Method: Log In (Authenticate)
Client Sends:

  • Username
  • Password (hashed with User’s Hashing Salt)
  • Application ID
  • UTC Timestamp
  • Hash of UTC Timestamp + Application ID salted with User’s Hashing Salt

API Returns:

  • API User Access Token

API Method: Any Command (i.e. Create Post, Update Profile, Get Messages, etc…)
Client Sends:

  • Command Data
  • API User Access Token
  • Application ID
  • UTC Timestamp
  • Hash of UTC Timestamp + Application ID + API User Access Token salted with User’s Hashing Salt
  • 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-09T18:37:39+00:00Added an answer on June 9, 2026 at 6:37 pm

    My suggestions

    1. Authentication and Authorization. Build it on 2 different servers(In some projects I have used 3 as well). Reverse proxy servers are really good with this. Authenticate on one server and authorize it on the other.

    This is the most important step I think that is needed in mobile security that use Web APIs.

    1. Encapsulate everything.

    2. Use SSL for all secure information. In my case I use it for everything.

    3. For your timestamp select a suitable time for which you can have authorization. Do not make this very short as your app will become slow or too long as network sniffers can access the packets.

    If you want a 3 server architecture For your requests have an application key as well that you use to generate a access key (from Server 1). This access key will authenticate your requests which after successful authentication(from server 2) you can use that key to authorize your requests from another server(server 3)

    The requests you have mentioned are standard norms. Don’t really see a problem with that.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

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.