Authorize, don't authenticate
Posted by marcua 3 days ago
Comments
Comment by jdub 2 days ago
An easy way to remember the difference between the As in AAA:
Who is your daddy, and what does he do?
^ authentication ^ authorisation
And the all too often forgotten final A is accounting, for which you can imagine Arnold writing down the interaction in his police notepad.:-)
Comment by noisy_boy 2 days ago
Who are you and what do you want?Comment by jambalaya8 21 hours ago
Comment by cindyllm 21 hours ago
Comment by jambalaya8 2 days ago
Comment by pestatije 2 days ago
Comment by ButlerianJihad 2 days ago
Comment by williamcotton 2 days ago
Comment by simonjgreen 2 days ago
Comment by ButlerianJihad 2 days ago
Especially of a series of ideas, letters, words, etc.: intended to help in remembering.
https://montypython.fandom.com/wiki/Bridge_of_DeathComment by simonjgreen 23 hours ago
So they have it covered then in their final sentence?
Comment by sandeepkd 2 days ago
The concept on a surface level to have ownership over the data makes a lot of sense and to a large part the support exists in a fragmented manner across the different providers/applications.
The concrete idea of user having a database and then authorizing that to the service is highly impractical. It might be applied for experimentation purposes in highly controlled environment but cant scale beyond that.
1. Databases require maintenance, backups, failover
2. Schema update are nightmares. No one is ever comfortable with it, specially the bigger you are.
3. Authorization seems to be following one to many pattern here, one database and multiple applications. Its a no go in case of update operations
Comment by socketcluster 2 days ago
I think this may end up happening naturally over the next decade or so thanks to AI coding. People will just stick web components bound to different data sources on the same page without even realizing it. Data can be joined and chained together on the frontend. Some shared authentication standard like JWT with asymmetric key signatures could potentially facilitate that. Multiple data custodians could verify the same JWT using the user's public key... Account could be hosted on some blockchain so it's not centralized.
Comment by sandeepkd 2 days ago
Theoretically even I love the idea of independence, however practicality of such a thing has to be evaluated. From all the examples that exists as of today, a true and meaningful decentralization is not viable in the absence of a a trusted centralized component.
Comment by marcua 2 days ago
Thank you for pushing on this. Some clarifications that might help you see this as more practical than your initial impression: * I totally agree that databases require maintenance, HA, etc. My argument is not that someone running a database magically doesn't have to do these things, but rather that the person running the database doesn't have to be the person running the app. In the video attached to the blog post, you can see that separation in action: marcua.net hosts the Todos app, but thedata.zone hosts an ayb [1] database instance. As the owner of thedata.zone, it's my responsibility to configure the database for stuff like offsite snapshot-based backups (which I've done). * Schema migrations are an application-level concern, and are no more or less challenging in the model I'm proposing. As a convenience, in the ayb.js client I open sourced, I add some utilities for forward-only migrations to make it a little easier for application developers who build around ayb to have migrations fire at the right moment in their application's lifecycle. * Authorization is definitely not assumed to be one database to many apps. In the video, look for how the user already has a streaks.sqlite database (for storing streak data) and creates a new todos.sqlite database for storing their to-dos.
Thank you for engaging on this! I look forward to hearing your thoughts!
Comment by sandeepkd 2 days ago
From practical standpoint you have to consider that the traditional use case for databases has been N:1 (n application instances, 1 DB) and you are inverting this.
There might be some unique B2C scenario where this makes business sense, however if you are providing database service then I cannot see how this would be any different.
On a side note, there are quite a number of B2B scenario where the client provides the DB for data residency requirements and the service providers uses that DB to manage the data on behalf of the client.
The price is also a big concern, a user scope database is going to be quite costly, as a provider you would end up sharing the infrastructure
Lastly I will repeat it again, schema migrations are as much as database level concern, and migrating N databases above a certain scale is not easy.
Comment by zobzu 2 days ago
Comment by pakl 2 days ago
(All too often the underspecified abbreviation “auth” is used to cover both.)
Shameless plug: My colleagues and I implemented a minimal authorization server that lets you leverage a trusted identity provider of your choice (like Entra ID or even Auth0/Okta) and handle authorization. It looks up what roles and permissions the identified user should be able to have/grant and issues tokens containing that authorization.
Comment by aquariusDue 2 days ago
Comment by _def 2 days ago
Sadly this approach does not work for a lot of (web) apps.
Comment by marcua 2 days ago
The solution I'm proposing does not assume the data is local to the user's machine. In the video attached to the blog post, a web application is authorized to access a database hosted by a different service/domain. While the blog post covers collaboration/social data as current limitations, I'm curious what other classes of web apps you think don't work with the proposed approach?
Comment by jmsgwd 1 day ago
Comment by mqus 2 days ago
Comment by happosai 2 days ago
Then we went to personal computers with local data and code.
Now we are back to a handful of massive timeshare machines (AWS, Azure, ..) that keep your data and let you only access with HTTP/HTML terminals.
Now if people get angry enough with Salas enshittification we'll go back to personal computers again...
Comment by ebiester 2 days ago
2. What stops me (or any attacker) from exploiting your lack of security? Are you 100% sure you are secure?
3. You mention collaboration - How does this work at a company level if we have many users and need to control access - the company is the entity with rights to the data in this case.
Comment by marcua 2 days ago
Thank you for your questions. I'll take a stab at answering them: * The underlying databases that ayb fronts are SQLite and DuckDB. Both are relatively battle-hardened RDMBSs. That said, I don't think the approach I'm proposing has any bearing on the difficulty of a query: if a centralized DB would struggle with a query workload, the personal DB is likely to as well. One saving grace is that workloads are slightly more isolated in my approach: someone else's data that's poorly shaped for a query shouldn't affect your queries, which is not something most all-users-in-the-same-database approaches can claim. * I make no special security claims beyond what is listed in the documentation [1]. ayb specifically has been used in production by low single digit numbers of people, so you should absolutely wait to use it for any super-sensitive data, especially in a shared/multi-tenant context. That said, you should be no more confident in the random web app that stores your data for you than you are in ayb's security. * This blog post is focused on personal data: the to-do list, the streaks/goals you've set out for yourself, your database of newsletter subscribers. I think there's some interesting work to be done in the enterprise around access control. In ayb, there are coarse-grained sharing/permissions [2], but I don't think that's enough for most enterprise situations.
[1] https://github.com/marcua/ayb#isolation [2] https://github.com/marcua/ayb#permissions
Comment by smallerfish 2 days ago
Comment by hansvm 2 days ago
Comment by explodingwaffle 2 days ago
Comment by warkdarrior 2 days ago
Comment by hankbond 2 days ago
1. Can I have access to my data (the side effects of my interaction with an application) in a portable way?
2. Can I stop or prevent others (like the application author) from having access to my data?
I wonder which -- if users had to choose -- they care more about? I think for most uses its #1 unless its very personal data, in which its #2. I love the idea as presented in this article but I'm not so sure how practical it is. I don't know how much overlap there is between "author has to run application a central server" (can't just be a local app) and "author must not retain data".
Seems like a really awkward space to inhabit.
Comment by marcua 2 days ago
Hello there! I agree users may want one or both of these features in their interaction with an application, and that their preferences likely vary depending on the type of data we're considering. The way I'm reading what you're saying, there's some sort of tension or tradeoff between the two features that I don't fully understand. Can you help me understand it a bit better? Thank you!
Comment by hankbond 1 day ago
I was thinking more along the lines of how I want the ability to export my data into something machine readable, and then delete it from the server. This allows for most conveniences and flexibility on the authors part to be available, but still provides the user with control over the data.
I think I just wanted to communicate that on the spectrum between no ownership and what your approach proposes, I'm less of a maximalist.
Thank you for the piece and the reply.
Comment by sqemo 2 days ago
In the end, it seems likely that everyone will develop and maintain their own web application, and if others need access to their data, they'll expose it through APIs.
Comment by brabel 2 days ago
Comment by zkmon 2 days ago
Authentication has historical reasons. Employee access, citizen services etc all are identity based. Identity was translated into authorisation for multiple services instead of each service requiring it's own authorisation.
Comment by skeledrew 1 day ago
Comment by esafak 2 days ago
How does the service know who you are? That's the point of authentication. Once that question is settled, the service can decide what you are authorized to do. You need both.
Comment by marcua 2 days ago
Thank you for asking. It's a difficult concept to wrap one's head around, but I think the video attached to the blog post shows it most clearly. There's no authentication with the application in the traditional sense, and the application never asks for your identity. You ARE authenticated with the database provider (ayb's thedata.zone in the video), which passes a token to the application so that the app can prove it has been authorized to access the database on future requests.
Comment by m463 2 days ago
Because when I saw "auth" ... was it authentication or authorization?
Comment by jdthedisciple 2 days ago
Comment by dspnc 1 day ago
Comment by ashleyn 2 days ago