from Hacker News

Why is OAuth still hard in 2023?

by bastienbeurier on 4/26/23, 1:41 PM with 282 comments

  • by remus on 4/26/23, 7:04 PM

    It'd be interesting to hear about people who have had a good time implementing OAuth, as my experience is similar to that in the article. I've played with adding it to a few side projects and the process usually goes:

    1. Read loads of docs, end up pretty confused

    2. Find a library that seems to do what I want

    3. Install this huge library full of opaque code doing...things

    4. Have an impossible time troubleshooting issues

    5. Get scared ("I'm almost certainly doing something wrong here") and give up

    I find it hard to have much faith in security standards like this. I want them small, well defined and understandable and OAuth does not meet any of these criteria in my experience.

  • by thepasswordis on 4/26/23, 9:06 PM

    Because the documentation is bad. Oauth is really simple:

    Lets say you want to use google as an auth provider. You do this:

    "Hey google who is this guy? I'm going to send them to google.com/oauth, send them back to example.com/oauth, and in the headers of the request include the word "Authorization: bearer" followed by a bunch of text"

    Google says "Oh yeah I know that guy, here I'll send them back to where you said with a token"

    Then later on you can take the token and say "Hey google, somebody gave me this token, who is it?"

    That's pretty much it. You have to trust that google isn't lying to you, but that's kindof the point of oauth.

    But that's never what the documentation says. It's always 10 pages long and the examples are like "here's a fully functioning python web server using flask and function decorators, oh the actual auth flow, which is really like 3 lines of code, is hidden inside of a library".

    To people who write documentation: PLEASE for the love of god show me how to talk to your API both using your library, but also using something like urllib2 or requests or something.

    Ideally the documentation is the absolute most minimal way of making the service work, and then adds more and more usefulness on top of that. I'm not going to judge you for writing bad code in an example. The example could practically be pseudocode for all I care. I just want to see generally how your API is supposed to work.

    edit: yes, auth0, I am looking at you.

  • by dathinab on 4/26/23, 10:05 PM

    1. because it's conceptually not an easy thing

    2. because the standard was messed up (instead of specificing a protocol with _at most_ one clearly specified flow per use-case (you can use it for more then SSO/Cross App Auth) they specified something more like a framework to build your own standard, but still pretended it's a single protocol, but if you can't use the standard to "blindly" build a client which works without knowing anything about the vendor then it's not a protocol, at least not a complete one)

    3. because the standard covers too much potential use cases

    4. because vendors haven't yet converged their implementations enough and might never do so (time for OAuth 3 which just specified on specific OAuth2 flow implementation??)

    Given that OAuth2 was started with clearly very different goals in mind and the main profiteers of the current situation are a few big companies like Google, Facebook and Microsoft I have heard people stating that OAuth2 being messed up was intentionally. _I don't believe so_, it more looks like a typical case of accidentally over engineering by trying to doing so much.

    I still don't like the situation as OAuth2 was too some degree a coffin nail to the idea of generic SSO (i.e. you as a customer can freely choose a SSO provider when signing one) and that sucks really hard and if we had generic SSO passwords would be _way_ less of an issue today (imagine _any_ email provider could _easily_ also provide a SSO service for any side you can have an account with).

  • by coderintherye on 4/26/23, 7:15 PM

    Related gripe: Your API doesn't always need OAuth. If I'm using your product as your customer and I directly want to leverage my own product data via your API then I shouldn't be forced to have to implement [your almost invariably non-standard and difficult] OAuth implementation. An API key should be an option or HMAC if the extra security is felt to be warranted, but not the absurdity of needing to go through a client flow to check the boxes to say yes I consent to share my own data with my own self for this API use that will never be seen or used by a 3rd-party.
  • by stcroixx on 4/26/23, 8:08 PM

    Probably because the part most of the world is actually interested in was later renamed 'Open ID Connect' and any attempt to research using the term OAuth will bring you nothing but incorrect, old, ad-hoc implementations and presentations by snake oil selling 'personalities' claiming they understand it.
  • by schlowmo on 4/27/23, 1:39 AM

    > OAuth is a standard protocol. Right? And there are client libraries for OAuth 2.0 available in basically every programming language you can imagine.

    Here lies another pain point of integrating OAuth flows: In my experience those client libraries are a lot better in following the RFCs than the authorization server implementations.

    It can cause a great deal of pain using such client library with a botched authorization server. If you take a look at the issue trackers of some client libraries you see a lot of "Please make this library work with auth provider XYZ" reports to which the maintainers (rightfully but painfully) respond: "Won't fix! We're following the RFCs here, we can't deal with every crooked authorization server implementation. Get it fixed at the other side."

    And then you have to take the decision if you want to patch the client library youself to make it work (with the risk that this patches break on updates of the client library) or if you roll your own client for that particular auth provider. This decision gets even more complex if you have to support multiple authorization servers. If it's only one auth provider the third option would be using a vendor specific client library, which may be as botched as the authorization server, but at least they can talk with each other.

  • by mkl95 on 4/26/23, 7:07 PM

    OAuth sucks. It's one of the worst abstractions of our time. It's incredibly easy to implement some half assed spaghetti and call it "standard OAuth".
  • by welder on 4/26/23, 6:10 PM

    Because it's too flexible, and allows the OAuth provider to choose which features they support. That puts all the complexity on the client to support every possible implementation.
  • by idlewords on 4/26/23, 9:39 PM

    I never understood how Oauth as a user experience is supposed to be distinguishable from phishing.
  • by mikeknoop on 4/26/23, 6:40 PM

    We have a joke about this at Zapier -- don't be an oauth butt!

    "We support standard oauth butttt..."

  • by defaultcompany on 4/26/23, 11:26 PM

    See "OAuth 2.0 and the Road to Hell" - Eran Hammer's resignation letter from his role as Oauth 2.0 spec lead author and editor:

    https://gist.github.com/nckroy/dd2d4dfc86f7d13045ad715377b6a...

  • by paulddraper on 4/26/23, 6:45 PM

    Example: What is the purpose of OAuth having specifications for redirect URI allowlist AND PKCE?

    None. They are entirely duplicative features.

    But ... reason, reason, reason ... they both exist, and are going to exist, forever.

    EDIT: I should say, PKCE is a functional superset of redirect URI allowlist.

  • by tommoor on 4/27/23, 1:36 AM

    It's not particularly hard, this article is just self-serving content marketing because their product is an OAuth wrapper.
  • by kierank on 4/26/23, 9:39 PM

    Is there any good way to do OAuth on a headless system? I want to be able to run batch jobs without a browser involved. There's OAuth for devices but that has limited real world use.
  • by pdobsan on 4/27/23, 11:34 AM

    A while ago I wrote a small utility mailctl [1] to provide IMAP/SMTP clients (like msmtp, fdm, isync, mutt, etc.) with the capabilities of renewal and authorization of OAuth2 credentials. mailctl acts as a kind of smart password manager. In particular, access token renewal happens automatically in the background transparent to the user.

    Since the program written in Haskell I also provided precompiled binaries to spare my potential users, most of them not Haskellers, from the complications of compiling it. The program have become moderately popular. However, little I knew how big can of worms I opened by releasing it to the public.

    As many others pointed out, the two main reasons for the difficulties with OAuth are 1) the OAuth "standard" is terrible complex 2) the service providers' API documentation is an impenetrable obscure mess, always one step behind of the current working system. I have the feeling that the second one is not just negligence but might also be an intentional hidden lock-in mechanism by forcing the use of the vendors' ever changing API libraries.

    [1] https://sr.ht/~petrus/mailctl/ also mirrored at https://github.com/pdobsan/mailctl

  • by cco on 4/26/23, 7:18 PM

    Love this post by Nango, it's exactly right!

    Agreed that the biggest reason is that OAuth is a framework and not a protocol. That means different companies can do it ever so slightly differently, and as a dev, you need to understand the differences and normalize it for your use case.

    At Stytch we've run into the same issues, normalization problems, security implications, flaky IdPs; a hard problem, but one you _have_ to get right!

  • by kayodelycaon on 4/26/23, 7:31 PM

    OAuth is such a pain in the ass for small projects. I miss api keys.
  • by Analemma_ on 4/26/23, 6:38 PM

    Because "OAuth" is not a thing, it's a label you can glue on any wild-and-wacky authentication mechanism someone hacks together. It is structurally impossible for OAuth to ever become "easy".
  • by dpcx on 4/26/23, 9:55 PM

    I don't know why it's still hard, but I can tell you, from the perspective of trying to prototype something, I would love to not have to use it just to find out if this functionality I want to build is worthwhile. I don't want to have to create a client, get some keys, worry about refresh tokens, etc. I want to hit an endpoint with an easily accessible token and get some data.

    Make it so that the token is only valid for 30 days or something and then it requires moving to OAuth. But for prototyping stuff with curl and bash scripts, it's a giant pain.

  • by glonq on 4/27/23, 6:22 PM

    My current project is the first where we decided to use "real proper" authN/authZ instead of a home-brew solution or a minimal solution like asp.net simple auth.

    I found that all the off-the-shelf solutions were either easy but expensive or cheap/free but difficult. I failed to find that mythical cheap or free and also easy and fabulous. Eventually we settled on self-hosted KeyCloak as the best bang for the buck. It took a bit of effort to get there, but we are happy with the results.

  • by codingclaws on 4/26/23, 9:00 PM

    I am in the middle of implementing an OAuth 2 server for my internet forum [0]. The last 10 or so commits are OAuth related. I read docs for about a month and now I feel like I can code it. One thing that confuses me is how it can work without a client secret (it's recommended to not use a client secret for SPAs and native smart phone apps).

    [0] https://github.com/ferg1e/comment-castles

  • by harrisonjackson on 4/26/23, 8:46 PM

    Nice read from nango team. FWIW we are using nango/nango cloud in prod to support ~15 integrations.

    We signed up before they had an admin dashboard and did everything over cli. It was easy then and even easier now. We have also contributed a couple of providers when they didn't have apis we wanted to use setup yet (Stripe, Zapier NLA). They have an open slack channel and we were able to get them shipped immediately.

  • by FpUser on 4/26/23, 7:32 PM

    I integrated my product using OAuth 2.0 with 3 other systems from 3 different companies. Each one required different code on my side. Not fun at all.
  • by smackeyacky on 4/26/23, 10:17 PM

    My various brushes with OAuth and OIDC and FAPI have been horrible. The spec is written poorly, everybody seems to have their own idea of how it should work, nobody seems to implement the same thing.

    Add to that the various version of OAuth/OIDC/FAPI and no clear migration path laid out to upgrade and it's a basic nightmare.

    The Australia CDR (Consumer Data Right) notionally supports FAPI but they have their own interpretation of what is right so you simply can't use an off-the-shelf library to do anything.

    The only way to preserve any kind of inter-operability is to wait for some other sucker to release their interpretation of this standard and everybody else in the eco-system has to test against that and eventually call it good.

    Add to that - I just can't see why it has to be that complicated. Sometimes you can request signed+encrypted tokens, sometimes not, you can query the provider to ask them what they support but there are holes and gray area defaults for algorithms and encryption schemes and the whole thing needs to be set fire to and abandoned.

  • by agentultra on 4/26/23, 8:23 PM

    My favourite are the appendices that amend the protocol to fix security issues that almost no API seems to implement properly. These can get quite long and are frequently amended with new drafts every year or two.

    For example, most APIs don't implement PKCE in order to prevent injection attacks against the authorization code grant type.

    Just keeping up with security practices is a full time job for teams.

  • by jwr on 4/27/23, 8:11 AM

    I wrote my own OAuth2 implementation (OAuth 2.0 Authorization Code Grant, both client and server side). I share many of the frustrations mentioned in the article.

    That said, my first thoughts when looking at the advertised service is that I would be adding a huge external dependency with all the associated problems. That's a big cost, and I don't mean just in monetary value. I now have to rely on the network, as well as an external company with a business model that might or might not work out for them. Said company is likely to get acquired or shut down, none of these outcomes are good for me. Also, external APIs are a pain to maintain (I found that on average an API gets completely rewritten once every 2-5 years, which if you have 5 external APIs means that you will be rewriting one every year).

    Also, OAuth has an unpleasantly large interaction surface with the rest of the software.

    As a counterpoint, if I could buy a good local OAuth2 library for Clojure (subscription is fine), I probably would.

  • by littlecranky67 on 4/26/23, 10:58 PM

    My rant about OAuth: It is overly complex because it has too many features to satisfy each and every enterprise case.

    For me who runs a simple website (no 3rd party login), I learned that OAuth2 is just not a good choice. JWE/JWT and samesite=strict plus HttpOnly cookies are reasonably simple, yet secure enough.

  • by xyst on 4/27/23, 2:06 AM

    Personally, I have transitioned away from these third party IdPs. I have turned to spinning up my own authentication and authorization stack using an open source ecosystem like "Ory".

    With just a single helmfile, I can deploy the entire application stack on my local machine (authN, authZ, smtp server,app db, application). Gives me ease that I don't have to rely on a third party vendor just for testing simple app flows. Transitioning to production is a simple swap of DSNs (database connection strings, real smtp servers, ...). Also, no more burning money when running simple tests or performing load tests with dummy users when using an external/managed IdP.

    Still need to experiment with how upgrading will work and migration of user data. But otherwise I am a happy user/developer.

  • by lbriner on 4/27/23, 9:01 AM

    As others have said, the main problem is that 1) There is too much flexibility which means that "name" might be "firstname" or "first_name" somewhere, which is why you need so many different implementations and 2) It is very hard to distill the relevant parts from the spec which covers all parts with equal vigour!

    We have the same issue with the UK Wiring Regulations, so they produced an "On Site Guide", which covers only the main parts of the main regulations and is about 10th the size. The same could be true of the OAuth spec.

    To be fair, OpenId Connect partially addressed both issues by taking a subset of the spec (when used for authentication) and then nailed down what the properties should be and what encryption mechanisms are required to be implemented.

  • by throwawaaarrgh on 4/26/23, 6:53 PM

    It was designed by committee, and the internet adopts any shitty technology that a big player pushes.
  • by cornycover on 4/26/23, 7:45 PM

    If you're struggling with OAuth I recommend reading this article from Ory:

    https://www.ory.sh/oauth2-openid-connect-do-you-need-use-cas...

  • by NaN1352 on 4/27/23, 10:09 AM

    OAuth is too abstract and that’s why it’s bad.

    I’m not a backend guy, for a hobby php site I’m trying to get Oauth2 with gmail free smtp, and the token refresh part to run on its own and even with packages like Phpmailer there’s no simple working copy/paste examples, just loads and loads of bits and pieces and outdated examples and small print about Google changed this or that… I mean wtf is the point of having a package that is supposed to abstract OAuth if you still end up having to dig for hours and having to figure OAuth2’s flow in detail?

    I’m so disgusted I figured maybe I’ll do the password with 2fa on that email acct and be done with it even though OAuth shpuld be the better option.

  • by rglover on 4/26/23, 9:05 PM

    From my experience, the blame lands on documentation and consistency at the implementation level. What should be a fairly simple process (redirect -> receive an HTTP request w/ code to exchange -> perform an HTTP request to exchange code for token) is always made into some esoteric spaghetti.

    I recently wasted hours implementing OAuth login for Bitbucket because their docs have bad links, bad explanation of params to pass, and bad explanation of endpoints to hit. I implemented Github and Gitlab just before in ~30 minutes total, so it really is a YMMV by provider problem.

  • by chowells on 4/26/23, 6:45 PM

    OAuth is easy in 2023. The problem is that OAuth does essentially nothing of interest by itself. It's a way to pass scoped access tokens.

    That's it. That's the end of the spec.

    If you want to do anything with those tokens, you need to implement against other APIs the provider makes available. Unless all of those APIs are also standardized, it means implementing a bunch of stuff for each integration. And now things are no longer easy.

  • by revel on 4/26/23, 9:51 PM

    Authentication is easy and solutions are more or less fungible, but there’s no obvious and easy way to do authorization. OAuth makes authentication pretty easy but all the complexity comes from authorization, which is adjacent to authentication but not directly related to it. Although it’s not OAuth’s job to help you with authorization, it’s an inevitable next step that leads to massively divergent approaches
  • by nige123 on 4/26/23, 7:14 PM

    GNAP is coming soon: https://oauth.net/gnap/
  • by 0xbkt on 4/27/23, 12:55 AM

    Tangentially related: what do you use today to make authn/z work for your web sites/applications where you only do first party login (i.e. you don't do social login etc.)? Create a `users` table in your database and implement the logic on your own? Or proxy to stuff like Ory Kratos and act as a translation layer through a network call?
  • by webjunkie on 4/27/23, 7:48 AM

    What I would like to highlight is that it's still quite an achievement to be able at all to authenticate users with dozens of different APIs. Could it be better? Sure. Could it be worse? So much. Just imagine everyone would be cooking completely there own thing, or there being fractions or competing "standards".
  • by nullandvoid on 4/26/23, 10:01 PM

    As a web dev next auth makes auth a breeze just add a provider and go (unaffiliated, just love how easy its made things).
  • by awill88 on 4/27/23, 5:35 AM

    It’s hard because the concepts of authentication and authorization are simple to abstract but hard to keep separate at a technical level. It’s actually super powerful once you futilely attempt to craft your own system that keeps the concerns separate.

    Oauth is authz

    But do get in “the door” you need OIDC + PKCE auth code grant.. or authn

  • by infogulch on 4/26/23, 7:11 PM

    What I don't understand is why all of these complicated SSO technologies like OAuth, OpenID Connect, SAML, LDAP, etc are integrated at the application layer at all. All these web applications should be using something like "Trusted Header SSO" [1], thus completely offloading authentication to the upstream reverse proxy (which does or should exist anyway) and then the whole problem vanishes at the level of the application. It's like the MxN problem that Language Server Protocol addresses, but here "M" is applications and "N" is authentication protocols. The fact that I have to hand over my administrator password to the grubby memory of random shoddy applications as they pass it over LDAP to authenticate me in my corporate "holy grail" SSO-everything environment is insane to me.

    [1]: https://www.authelia.com/integration/trusted-header-sso/intr...

  • by lukev on 4/26/23, 11:48 PM

    Given that this seems to describe a real problem, why hasn't anyone launched a proxy service that normalizes across the varying implementations?

    Why should tens of thousands of developers have to discover the particular quirks of an implementation instead of doing it once and re-using the results?

  • by jrm4 on 4/26/23, 9:06 PM

    I'm not super familiar with all of it on a tech level, but is some of this because individual apps that shouldn't exist hoard it?

    In my case it's Duo, literally the only 2FA thing I must use that doesn't let me have my dang token so I can use whatever app I want?

  • by bebop on 4/27/23, 12:31 AM

    If you want to read the rfc’s I had chatgpt explain the parts of the authorization code flow and link where in the rfc’s the parts are defined.

    https://bryce.groff.family/oauth-2-1/

  • by davidguetta on 4/26/23, 9:04 PM

    Use fief ! By the creator of FastAPI
  • by 6510 on 4/26/23, 6:33 PM

    It's a turd, if you want poor security you should make things so complicated that half the implementers have no idea what they are doing. We should have a kind of LD50 for specs: How much feature cruft do you need for 50% of the test subjects to die.
  • by znpy on 4/26/23, 10:11 PM

    Because authentication and authorization is a hard problem in general.

    Hard to make it right, hard to make it secure, hard to make it simple. And exponentially harder to make it versatile.

    And if oauth is "hard", wait until you see OpenID and the myriad of extensions...

  • by jamietanna on 4/29/23, 7:01 AM

    On point 1, that's why https://oauth.net/2.1/ is in the works, to make a smaller, clearer subset of things that folks need to read and implement
  • by eru on 4/27/23, 9:10 AM

    Somewhat offtopic:

    HN shows me the name of the submitter, bastienbeurier, in the colour #cd6e00. (Not sure what people call that colour in natural language, as i'm colour-blind.)

    What's up with that? The account was created in 2013.

  • by TobyTheDog123 on 4/27/23, 1:09 AM

    No one implements it the same way.

    Some require scopes, some don't.

    Some require comma-separated scopes, some want an array.

    Some require an HMAC signature, some don't.

    Some want a JSON body, some want a urlencoded form.

    Etc.

    Etc.

    Etc.

    You're never implementing OAuth, you're implementing some company's bastardized flavor.

  • by tristor on 4/27/23, 1:15 PM

    Because the underlying problem is hard. SAML is difficult too. Identify federation, across the public Internet, between disparate entities is a fundamentally difficult problem with no simple answers.
  • by wooptoo on 4/26/23, 9:46 PM

    I found this tool useful for debugging Oauth: https://github.com/cloudentity/oauth2c
  • by bullen on 4/27/23, 11:37 AM

  • by domrdy on 4/27/23, 1:41 AM

    I've been using WorkOS for my SaaS products and I'm pretty satisfied with it. It's straightforward to set up Google/Microsoft/MagicLink (free), including staging and production environments. The best part, though, is that it lets my enterprise customers configure their own SAML/OpenID Connect IDPs.

    I get charged per connection, so I just pass that cost onto my customers. As a solo developer, I'd have a hard time supporting so many IDPs with a unified API without this.

    They did recently hike up the cost per connection, but they're giving a one-year extension at the old rates, which seems fair.

  • by chrishannah on 4/27/23, 10:15 AM

    I think sometimes OAuth providers explicitly explain it in a more complex way, just so that you would use their bespoke platform/services to implement it.
  • by StillBored on 4/27/23, 2:27 AM

    I don't know, I look at oauth and it seems like its insecurity by design. Huge complex spec, with lots of corner cases, and requires really complex functionality like HTTP and JS. All of which can hide obscure bugs. Its like no one has learned from history.

    Frankly, I'm not sure what keeps people from simply putting fake Oauth screens on random phishing emails. Figure out what a companies default auth screen looks like, pop up a similar looking web page.. bam plaintext passwords that can be used to authenticate with real services.

  • by nektro on 4/27/23, 10:08 AM

  • by andix on 4/26/23, 9:33 PM

    Because most OAuth libraries are very incomplete.

    They implement a few happy parths of the standard, but a lot of things are just not there.

  • by superkuh on 4/26/23, 11:19 PM

    Oauth is simple. OAuth2 is a protocol for making protocols and every mega-corp's implementation is different. It's requirement for email access in the mega-corp walled gardens breaks imap in the sense that just imap doesn't work anymore. And in the pragmatic sense that many smaller email clients don't and won't support all the various idiosyncratic implementations.
  • by jwmoz on 4/27/23, 9:42 AM

    I HATED having to do anyting with oauth back when I did more web work. Think it actually gave me PTSD.
  • by dekhn on 4/26/23, 8:20 PM

    because it was a dumb standard with terrible implementations solving a problem that nobody had
  • by anarchogeek on 4/26/23, 9:44 PM

    Because OAuth 2.0 sucks and got all bloated. The 1.0 version worked great for everybody but super big companies like google and facebook. But then big companies came in and made it a bloated standard that doesn't meet the needs of most users.
  • by indus on 4/27/23, 3:22 AM

    Not one mention of flickr in your post...Would have loved it.
  • by wslh on 4/26/23, 6:28 PM

    Thank you for "asking" and have the luck of appearing in the first page in HN. I am sure many here wonder why. There are more complex pieces of software that find a way to abstract the problem in a nice interface.
  • by 29athrowaway on 4/26/23, 11:04 PM

    If you use OAuth make sure to use stable sorting.
  • by emurlin on 4/26/23, 10:58 PM

    I can't seem to find an old article written on the early days of OAuth 2.0, praising OAuth 1.0a, because among other things it signed the URI parameters and because unlike OAuth 2.0 Bearer tokens, OAuth 1.0a didn't require sending credentials in the clear (this was at a time when HTTPS wasn't quite as ubiquitous, and OAuth 2.0 pretty requires TLS to be used securely).

    As someone often working with OAuth 2.0 flows, I enjoyed the article and think that it raises many good points. I'd also say that many of them come from things that affect _any_ system solving a problem similar to OAuth 2.0, because authorisation is hard to get right, or from extensions to the protocol that really aren't OAuth 2.0's fault (like the `realmID` parameter, obviously added to make the life of those API developers easier at the expense of those actually trying to integrate with their systems).

    To me though, I wholeheartedly agree with 'Problem 1: The OAuth standard is just too big and complex' and 'Problem 2: Everybody’s OAuth is different in subtle ways'. OAuth 2.0 is more of a framework or metastandard, and no API implementation uses all parts of it because they simply are not relevant to that API or use case. This alone makes it quite hard to 'simply use OAuth' for an integration, because a big part of the job is figuring out which parts are used and in which ways, even if everything is done per the RFCs.

    By contrast, OAuth 1.0a was comparatively much simpler and focused on a more narrow problem. OAuth 2.0 allows you to convert a SAML claim from one provider into an OAuth 2.0 token for a different provider to then delegate permissions conditionally to another actor for a particular action on yet another API.

    Are we better off with OAuth 2.0? I say yes, because figuring out the differences between providers is probably easier than realising a hundred completely different implementations that have very different ideas of what an authorisation or delegation flow should look like. I think that one can learn to reason about OAuth 2.0 and then apply this logic to integration jobs with slightly less cognitive load than a completely bespoke solution.

    At the same time, I think something sorely needed is something like OAuth 2.0 profiles that standardise the features used to integrate with OAuth 2.0. Probably most social media sites have similar requirements, most auth-as-a-service have similar requirements and so on. Having a common subset of features and decisions for common use cases and scenarios would IMO greatly simplify integration tasks and, paired with choosing a good library, make it indeed possible to integrate with a random service in under an hour.

    The thing is that some of that was the spirit of older standards like OAuth 1.0a and OpenID (not to be confused with the newer OpenID Connect, which is OAuth 2.0-based), and the world seems to have moved away from that, probably because of the flexibility that OAuth 2.0 affords and the want to tightly control authorisation and external integrations.

  • by lukeed on 4/26/23, 7:51 PM

    It's easy with https://btn.social/ :D

    I made this because I was tired of asking the same question.

    There are a bunch of services out there trying to address the same thing, but unfortunately they get wildly expensive and they own/control your user data.

    Professionally, I've been a consultant and freelance developer for 10+ years. Time and time again I'd see teams start with Auth0/etc, only to eventually:

    1. duplicate user data into their own DB/Cache to avoid the latency of asking Auth0 for user data

    2. remove Auth0 entirely because having active users !== having paying users... so Auth0's monthly bill of $3000 to $10000+ couldn't be justified

    3. #1 then eventually #2

    btn.social is just as simple to set up, but has predictable & transparent pricing with volume discounts the more you use it. At its most expensive, it's 100 logins per penny ($0.01), which is to say that "MAUs" are a thing of the past.

    As quick pricing comparison:

    - Auth0's (public) pricing calculator [1] shows 10k MAUs for $228/mo. That just means 10k users logged in 1+ time(s) that month. In btn.social terms, that's 10k, 20k, or 30k logins depending on if each of those users logged in 1x, 2x, or 3x (etc). For $5, you get 50k logins with btn.social.... and for $169 you get 2.5M logins... [2]

    - Supabase charges $25/mo, which includes a lot more than just OAuth(!) but if you look at Auth alone, that $25 includes 100k MAUs and is an additional $0.00325 per MAU thereafter [3]. Assuming 1x login per MAU, that's $2950/mo for 1M users. With btn's "Business" tier, you get 1M logins for $79/mo, but of course there's still the $169 for 2.5M if you don't like the "1x login per MAU" assumption.

    Another key difference is that btn.social saves nothing about your users.

    It's your app so you get to keep your data. You'll never need to have to ask btn.social for Alex's profile because we won't have it :D This means we're privacy-first & we don't add/pose a risk for GDPR concerns.

    btn.social was just launched last week [4], so some additional guides & examples are still underway, but there are already 10+ OAuth providers [5] to choose from & a free/"Hobby" tier so anyone can start playing around in just a few minutes.

    [1]: https://auth0.com/pricing

    [2]: https://btn.social/#pricing

    [3]: https://supabase.com/pricing#compare-plans

    [4]: https://twitter.com/lukeed05/status/1648751062340501505

    [5]: https://docs.btn.social/providers/

  • by firatsarlar on 4/27/23, 6:04 AM

    It's some kind of misty cristal, requires high up, high up ... A few could really grasp that