4 ms·
> Your authentication state is not "logged in", it's "logged in as user X". So the code that decides whether a client can see a specific page can and should (!)
by friendzis 8y ago
> Your authentication state is not "logged in", it's "logged in as user X". So the code that decides whether a client can see a specific page can and should (!) depend on what specifically you're authenticated as.
"the code that decides whether a client can see a specific page" should not care about authentication, this is authorization issue. I see these things conflated too often.
Identification, Authentication and Authorization are three different beasts. Separate identification seems unnecessary complication, which it is in simple web app, but in a more complicated case where ID is not user supplied (login over external service, read ID from smart card, etc.) it can become a necessity, which can be embedded into authentication mechanism. Authentication mechanism should only provide "authenticated" and similar (e.g. "authentication security level") flags, because authentication at its root is a mechanism to establish trust that client has control of certain ID, nothing more.
- phito 8y agoSometimes I wonder how technology can work, when so many people working in the field are unable to grasp the basic concepts of it
- chii 8y agoEither the competent pulls way more than their weight, or luck.
- yjftsjthsd-h 8y agoAlso the really bad stuff sometimes dies under its own weight. Natural selection occasionally works.
- Double_a_92 8y agoHave you looked at recent at auth tutorials for NodeJS and related frameworks? You (a potential beginner) have to basically implement everything yourself or use some 3rd party service. There just aren't any good libraries available. I once tried some random framework I found where the example auth project that they provided had exactly the problem you described. You could log in and then do everything if you called the api endpoints manually... Deleting and editing other users profiles? No problem.