TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do I ensure that a real iOS client is using an API

4 点作者 evilswan超过 13 年前
Hello HN! Hoping I can tap the colossal power of the HN hive-mind.<p>Working on a project where an iOS client hits an API. How do I ensure that only my 'real' client is allowed to use it?<p>I could bake a secret token into the app, but surely it will just be sniffed (HTTPS only, but a MITM proxy?) or the app decompiled and the token extracted (Like the Sony PS3 master key).<p>Is there any reliable way to ensure that a hacked, dummy version of my app can't use the real API?<p>Thanks HN!

3 条评论

saurik超过 13 年前
This is not possible. You should design your architecture so that this either does not matter or has a bounded cost.
评论 #3592656 未加载
edlea超过 13 年前
This is something that the BBC did with iPlayer: <a href="http://po-ru.com/diary/device-discrimination-on-the-internet/" rel="nofollow">http://po-ru.com/diary/device-discrimination-on-the-internet...</a><p>I've not quite worked out how to implement it though
评论 #3591622 未加载
toolmaker超过 13 年前
How about this:<p>1. Use the current GMT date/time to generate an encrypted api point like adfa923asdf.yourdomain.com. 2. Make it change every day. 3. For all other hostnames besides the correct one for the day, dump random data so the fake app cannot tell whether or not the api is giving out the right results for sure. All your apps will be pining the right api end point where as the fake ones will have a hard time catching up.<p>Also, use authentication on top of all of this.