-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Continuing on from our discussion in: #268
and with the benefit of our knowledge from Flutter and JS-land ...
Trying to think about auth from first principals ...
How are we going to enable auth in our Flutter app with the least code possible
and without the need for keeping "secrets" ... π
Why do we have an AUTH_API_KEY in the first place?
We (I) created an AUTH_API_KEY because I thought that it was needed for identifying/verifying which App is using auth for authenticating the person. But when I think about it with my beginner's mind I'm forced to think "Why...?" π€·ββοΈ
If someone is running a Phoenix App on localhost then we know they are in "Dev" mode, right? π©βπ»
So why do they need to have an AUTH_API_KEY to identify them? π€
The AUTH_API_KEY doesn't provide the person using the app any additional security
it's just an extra step for the Dev/Engineer to setup ...
Does auth need an API_KEY or can we just do domain-based verification? π
Can we just create an "Allowed List" for urls that are allowed to use auth and reject any other URL?
We currently require the URL to be defined for an app, e.g: https://auth.dwyl.com/apps/45
If we are doing a domain-based verification, then do we need an AUTH_API_KEY? π
What real additional security is the AUTH_API_KEY giving us?
Is it just perceived security because we've been trained to think that API Keys are the "right" way to do this? π€
How will an attacker exploit a system that only has domain-based verification?
Hypothetically, if we were to completely remove the AUTH_API_KEY,
how would a malicious person ("attacker") attempt to use our auth system
to get people to login with their Google/GitHub/etc account and steal their data? π
If the attacker can intercept a request or create a fake page that looks like our App,
and use our own auth endpoint to authenticate a person and then replay
the successful JWT back to the App they can read the person's data ...
How can we do domain-based verification on a Distributed App?
If our Flutter App is web-based or deployed to the App/Play Store,
will there be a "domain" for it? π
And if there is no domain associated with the "Native" App, how do we verify it? π€·ββοΈ
Is there a unique string associated with the iOS or Android build that cannot be spoofed?
These are the questions that are on my mind right now as I'm thinking about auth in general
and specifically gearing up to re-write auth from first principals to be an order of magnitude simpler.
Note: Please only comment if you understand the security implications of this question. π
i.e: you have done a bit of white/grey hat hacking and understand how "hackers" think about compromising systems. π¦ΈββοΈ
