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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:49:15+00:00 2026-06-13T04:49:15+00:00

The scenario is: I have a web API, which is being accessed by two

  • 0

The scenario is:

I have a web API, which is being accessed by two clients:

  • Web App written in Javascript, which is minified
  • iOS App

SSL is all set up on the server hosting the API, and it works fine. There is no User Auth for the API because it’s a sort of location-based searching app.

I want to ensure though that only the web app and the iPhone client are able to actually make requests to the API. For the iPhone client it’s easy – a shared secret between the server and the app will do, and it’s encrypted with SSL so we’re not worried about people spying on it.

But for the web app the same solution won’t work. I can’t just leave a string in the code, and even if it’s encrypted in there that’s all somebody would need.

Basically, I’m looking for a good solution to this problem. I just want to make sure it’s kept only to clients who are allowed to use it, but I’m not sure how I can without going and implementing OAuth which I think is probably overkill. Any ideas?

Thanks!
Dan

  • 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-13T04:49:17+00:00Added an answer on June 13, 2026 at 4:49 am

    It can’t be done. Even with oauth. Even assuming that your iOS app is secure, is wrong: it can be decompiled. Any code that runs on the client, can be tampered with, and can’t be trusted to be who he says he is.

    Only question is: is the API you provide valuable enough, and how much trouble would someone want to go through to hack it. And how hard do you want to make it for whomever wants to hack it.

    The iOS version is indeed way safer than the javascript version. In the webapp you can obfuscate your code to make it harder to hack. You can (if you don’t intend to use it on iOS) use java or flash to further hide your signing code (HMAC-sign your requests, don’t just send a shared secret with them. You may think SSL is secure, but there is a moment before the url is encrypted….).

    The way the “big guys” deal with this is:

    • Whatever you build, assume that someone will be able to hack it (as in: use your API for some other purpose than you intended).
    • Think about how bad this really is (note: they wouldn’t be able to build a business on it; it would be WAY TOO vulnerable to lawsuits). Is it really the end of the world if a lone wolf uses your API.
    • If you do care about the lone wolves, make it as hard as possible (but honestly, isn’t it cheaper just to loose some money from the lone wolves, than to spend 2 developer-months on it?)
    • If somehow there is serious interest in hacking into your API, try to come to an understanding with the hackers (e.g. I like the way how Spotify reacted to despotify. Basically they said “hey, if you don’t release anything that makes it really easy to steal our music or circumvent our businessmodel, we won’t try too hard to block you”)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Web Api and have a scenario where clients are sending a heartbeat
I have a scenario in a java web app, where a random hexadecimal value
Here's my scenario: I have two web applications that are hosted on seperate servers.
Scenario I have an web application which needs some calculations and processing on data.
This is the scenario: I have a web page with a ListView lv_create_claim which
I have an asp.net web api application which is acting as a Relay to
SCENARIO I have to access a web service with a .NET client. The service
I have scenario where I need to host a web service (WCF) on Azure
The Scenario I have an ASP.NET web project. I want to be able to
Let me share the following scenario: I have a ASP.NET intranet Web-based application that

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.