There is no simple way to verify the identity of the app that sent the intent.
Yeah, I think I've read that in the forum. That's why in my example the client added an extra field with its own package name so that the ID app knew where to send its response.
Also remember that a hacker can create an app with the same package name and send the intent.
You don't mean via the app store, right? In there they all need to be unique, I think. But assuming I haven't installed the official Facebook app, I would be able to whip up an app in B4A using the package name
com.facebook.katana (same as Facebook app) and then be eligable for responses from the ID app. That's what you mean, right?
So perhaps intents aren't a good fit for secure communication. And using sockets wouldn't really improve anything at all, right? Just same complexity, but different communication method?
I'm starting to think that the bank app and the BankID app don't have any sensitive exchange at all. Perhaps it's more like this:
- Bank app connects to its backend and informs its waiting for confirmation of my identity
- Bank backend communicates with BankID backend, informing "Bank App For MegaBank" is requesting my identity
- Bank app launches BankID app
- BankID checks with its backend to see if there's a waiting request for identification
- BankID finds waiting request, asks me to enter password and sends that somehow to its backend
- BankID backend verifies my identity and sends an OK to bank backend, which in turn gives thumbs-up to bank app
- Bank app is logged in and ready to be used
Using this flow it's a super simple IAC between the apps, it's basically just an explicit intent to launch the BankID and then BankID returns once there's a success or fail of some sort. It's up to either app to solve the security between itself and its backend.
Makes sense, doesn't it? Would you say it's probably done something like this?
You can use password noncing to prevent replay attack
But that would only be completely secure if you updated the nonce for every request, isn't that correct? If you "just" limit it to a time window, it's the same as having a vanilla hash, you just have a tighter window of potential (mis-)use. Taking a quick look at the cookies here, it seems posting my nonce would give people a five hour window to use my identity? (assuming I don't do anything before somebody else, thus invalidating the posted value)