Allowing for a fully OAuth integrated migration flow. aka. killing createAccount

As part of https://tangled.org/did:plc:epbi6paber3mxm7237xkwvj5/spec/issues/36 @bnewbold.net mentioned he thinks that the createAccount endpoint has been largely an antipattern and I’m very inclined to agree. In Tranquil we have a bunch of account level features (passkeys, totp, delegation, alternatives to email, etc) that aren’t covered by the core createAccount interface. This has meant we largely extended that interface to cover our additional features, however those extensions are of course not a protocol standard and as such aren’t very useful for ecosystem tooling that wants to remain generic.

createAccount is today used in two flows:

  • Initial account (and usually identity) creation
  • Account (but not identity) creation during migration

For the former we are slowly but surely aiming to standardise on adopting the existing prompt=create OAuth authorisation parameter from OICD. I think we all more or less agree that that is working quite well, but it does not cover the second use case! This is getting quite important for us at Tranquil now that we are going to remove our in-house migrator in favour of focusing community efforts on PDSMoover and the like. Not having the in-house migrator means there is no longer an option to use those extra Tranquil features from the get-go when migrating an identity. On the other hand @pds.dad doesn’t currently have an option to generically support these features in PDSMoover, so there isn’t really a good way forward.

createAccount has also over time gained a handful of fields that specifically support the reference implementations implementation specific usage of the endpoint. In my opinion these don’t belong anywhere near an endpoint in the com.atproto namespace. Having previously voiced my annoyances about that, @thisismissem.social came in to mention how she also thinks that createAccount is an antipattern we should get rid of, and that the current state of the createAccount schema is a by product of that. Which I also think is a very true assessment.

All of that is to say: I think we should try to completely kill createAccount. We’ve already begun with prompt=create! We just need to standardise that as well as a solution for account creation during migration. I believe the way forward there is also to shunt it to the OAuth level ie. a prompt=migrate of sorts. This is the level at which these potential additional implementation specific features already exist after all. The purpose of this OAuth flow would be to create the new to-be-migrated-to account and return, to the migration tool, an OAuth session for said account that’s usable for the rest of the migration flow (eg. this session must have the appropriate permissions to import the old accounts data to the new account). However this OAuth flow would also need a solution to proving control over the identity in question. createAccount is currently called via inter-service auth during migration. This works quite well but can’t be applied one-to-one to an OAuth flow. Another thing to consider there is that we ideally want this flow to work such that the actual end user only has to log in to their current account once. That’s how it currently works and i believe that to be the most user friendly option. I’m sure there are some things I’m forgetting here that also needs to be hashed out, either way I want to hear everyone else’s thoughts here.

3 Likes

It’s not just that I believe that “create account” is something that should be deprecated and removed, but actually that the following lexicon procedures or queries under the com.atproto.server should be removed:

I could be convinced to say checkAccountStatus should stay, but I think the PDS should inform you of your account status if it changes (via email); though maybe this is more useful for sync?

For prompt=migrate we’d need to define a OAuth/OIDC extension specification document for it, and specifically what the request parameters are, because we’d be somewhat limited to what exists currently in the IANA OAuth Parameters registry.

(fwiw, here’s how headless or low-input devices could still work with these XRPC methods removed: [Spec Change Request] Support for Device Code Grant Flow · Issue #824 · bluesky-social/atproto-website · GitHub )

1 Like

(Also to be clear I’m not sure we should go with specifically prompt=migrate here. We could just as well do it as an extension to prompt=create just like the current createAccount approach does it as an extension to that. Arguably that’s also more “correct”. In both cases we ask the AS to prompt the user to create an account. The details there are something to hash out together I think)

1 Like

Rough summary of notes from my exploration session with Claude the other day (it wrote this summary now based on my thoughts & thinkig through things the other day):

I think a good direction for replacing the migration path through createAccount is OAuth with prompt=create plus Rich Authorization Requests (RFC 9396). The client sends an authorization_details entry over PAR with an atproto-defined type, something like:

[{
  "type": "https://atproto.com/oauth/account-migration",
  "did": "did:plc:…",
  "service_auth": "<JWT from old PDS, aud=new PDS>"
}]

The new PDS verifies the proof against the DID document, the same as createAccount does today. It can also show a proper consent screen (“You’re moving @handlehandlehandlehandle here from pds.example”), and the password never touches the client. Instead of a service-auth token, the proof could be a JWT signed by one of the account’s keys. The spec would only need to define one authorization_details type, with no new OAuth parameters.

These ideas are obviously very rough but moving towards RARs is absolutely necessary as auth gets more complicated; scopes simply do not suffice.

Relevant specs or I-Ds:

1 Like