So I'm looking for a secure way of passing data between two applications (trying to implement a secure OAuth provider for IOS applications). Here is my definition of secure and some additional assumptions/requirements:
- I want app A to invoke app B and pass it a token TokenA, then app B fetches some result based on this token, and return the results back to app A. Assume there is a malicious app called app C, I want to make sure that app C cannot intercept any messages between app A and B.
- Assume TokenA is some public information that app C can obtain. I want to make sure that app B does not respond to a request with TokenA unless it comes from app A.
- Assume app B is actually a "service provider" and app A can supply some info to app B (e.g., IOS bundle ID) when app A registered to use the service.
- The secure messaging method must not require a jailbroken phone.
- Assume app C can be installed before or after app A and B.
Originally, I thought about using some scheme-based approach, but this is not secure since if app C can register for the same scheme as A and B, then intercept the message (violation to requirement 1).
Checking for duplicated intent is also not enough, since if the user does not have app A installed, the attacker could register for the scheme of app A and bypass this check (violation to requirement 2).
I looked at Facebook's IOS OAuth, and they seem to require apps to enter their "bundle ID" when registering with Facebook. I am quite positive that Facebook is using this bundle ID in some kind of checks, but not sure what.
Any help is appreciated.