Imagine a scenario where you have valuable data coming from an API (mysite.com/api/OooOOooData), and you need to ensure that access to it is limited to the designated iOS / Android app. It's crucial for the data to be connected to the correct advertising through the apps. Allowing unauthorized usage of the API could result in giving away the data for free without any benefit from advertising, or even worse, other developers might exploit it for profit.
If this were a web-only application, controlling access within my own site wouldn't pose a problem. Since managing access is common and essential in web applications, I suspect that there must be solutions available for other technologies as well. My project utilizes web technology with Cordova, lacks a user system, making traditional authentication methods unfeasible.
The only method I've considered implementing involves embedding a key within the code and sending it along with all Ajax requests, requiring the server to validate the key. However, since the code is stored in a private repository, only users with jailbroken devices would have visibility to it – which presents significant security risks.
Is there an established, secure protocol for addressing this issue?