by anderspitman · 6y ago · 0 comments
Imagine a SaaS that sells domains, then provides and easy (and open) API for delegating control over subdomains using OAuth2.
So I sign up for sheetui, and during the registration process they redirect me to a namecheap.com (where anderspitman.net is registered) OAuth2 server, I grant them control over sheetui.anderspitman.net, and they can now host there on my behalf.
sheetui.com also shouldn't have to deal with TLS certs. Why doesn't namecheap.com handle that for me?
HTTP requests can be proxied through something like ngrok which again uses OAuth2 tokens for auth. Now we have a stack where people can securely host websites from there phone.
What issues did you run into with OAuth2? Are you open to sharing your design doc?
One of my goals was that the flow could start from a service provider - you type in the domain name you want the service to be bound to on the service provider's website, and it goes from there. If you were to use OAuth2 at this point, there's no existing client ID/password, and allowing public dynamic client registration leads to DoS potential as someone could easily register a practically infinite amount of clients and fill up disk space. So you want a custom flow which winds up, at the end, with the consent of the domain owner, returning OAuth2 credentials to the service provider. This flow is fairly complex to spec out in a way that doesn't have subtle security issues (e.g. this initial flow can't trust much info from the service provider which could be something akin to a phishing scam, returning to the service provider on error has to be done carefully because of risk of being used in an open redirect chain, etc).
After that it's mostly a case of supplying auth keys for RFC2136 so the service can manage its delegated domain, handling credential rotation, and properly handling edge cases like either the service provider or the domain management system losing track of state, or the domain being lost/transferred to another entity.
Honestly I'd like to build something like this for my own projects, and might do so as a weekend project soon, esp since it's just been validated as something useful. :D
I'm not a big fan of pre-registered clients in the first place. Ideally any client should be able to talk to any OAuth2 server that speaks the same profile, ie endpoints and scopes. Aaron Parecki describes a way to allow "anonymous" clients here[0]. As I understand that's how IndieAuth is implemented. But I'm still relatively new to OAuth, and I don't doubt there could be subtle security issues. Do you have any thoughts on that?
[0]: https://aaronparecki.com/2018/07/07/7/oauth-for-the-open-web
For example I'm working on a project right now that's ideal for self-hosting, but I really want to encourage people to use their own domain names, and registering them and handling HTTPS is a rather large barrier.