Has anyone tried using custom HTTP headers (e.g. X-App-ID) to authenticate the client app to the server?
Long version:
I'm running a cloudKVS setup where the B4J server (a VPS with SSL) has the central key-value store, and the users use a B4A app that syncs with the server.
I'd like to make sure that the server only accepts requests from my B4A app. So this seems like an authentication question. (I already have logic that checks that certain users (identified by email address) have permission for certain requests.)
Before I consider formal authentication (e.g. FirebaseAuth), I'm wondering if there are simpler solutions where the client app convinces the server that it's a legit sender, not some hacker's script.
I read a bit about the Google Play Integrity API, but didn't find any ways to use it in a B4A app.
I'm wondering if adding a custom HTTP header to the KVS Post calls would mostly solve this:
The server would then check the header value against its own stored password. If they don't match, it ignores the request.
That would also mean securing the password at both ends, but there are ways to do that.
Does this sound reasonable for achieving decent server security? Or should I stop trying easy shortcuts and just learn FirebaseAuth already?
Long version:
I'm running a cloudKVS setup where the B4J server (a VPS with SSL) has the central key-value store, and the users use a B4A app that syncs with the server.
I'd like to make sure that the server only accepts requests from my B4A app. So this seems like an authentication question. (I already have logic that checks that certain users (identified by email address) have permission for certain requests.)
Before I consider formal authentication (e.g. FirebaseAuth), I'm wondering if there are simpler solutions where the client app convinces the server that it's a legit sender, not some hacker's script.
I read a bit about the Google Play Integrity API, but didn't find any ways to use it in a B4A app.
I'm wondering if adding a custom HTTP header to the KVS Post calls would mostly solve this:
B4X:
job.GetRequest.SetHeader("X-App-ID", "insertCleverPasswordHere")
The server would then check the header value against its own stored password. If they don't match, it ignores the request.
That would also mean securing the password at both ends, but there are ways to do that.
Does this sound reasonable for achieving decent server security? Or should I stop trying easy shortcuts and just learn FirebaseAuth already?