Alright, I have this app.
It's a versatile one - can run on mobile devices or JavaScript platforms. Works across Windows, Apple, and Android systems. The app comes equipped with a logging API that requires an API key for operation. Specifically, before any logs are made, the API key needs to be provided. One crucial log entry is for failed login attempts! This means the API key must be accessible before the user even logs in. But where should it be stored?
I know I can't simply place the API key within the app itself, such as in a settings file or directly in the source code, as all of that data is visible to the end-user. Also, using OAuth2 to fetch the key from a server is out of the question since the user hasn't been authenticated yet, making it impossible to generate the necessary hash. Storing the key in the keychain won't work either, because ultimately the API key will still need to exist within the app bundle upon downloading in order to then store it in the keychain securely.
So, what's the solution? Where should I keep this vital API key?