An app using Sign in with Apple has already been transferred from an individual developer team to an organization. Existing backend accounts still reference the original team-scoped user identifiers. We are within the 60-day migration window, but no transfer identifiers were generated before the transfer.
The original team has no existing Sign in with Apple private key. In Certificates, Identifiers & Profiles, creating one is disabled because there are no eligible identifiers to associate with the key after the app transfer. The recipient team has its own Sign in with Apple key.
TN3159 describes using a client secret issued by the source team to generate transfer identifiers. What is the supported procedure to generate those identifiers in this situation and safely associate existing users with their new team-scoped identifiers? Is there a supported way to obtain an appropriate source-team credential after the App ID has transferred, or an alternative migration method?
Does expiration of the source team’s Developer Program membership affect the availability of the 60-day migration process or the credentials required for it? We have not modified existing user identities and want to avoid creating duplicate accounts.
No private keys, user identifiers, or account details are included here.
Hi @eduardomanrique,
Thanks for the detailed description. You haven't changed any user identities yet, so you can still migrate without creating duplicate accounts.
1. Creating a Sign in with Apple key on the original team
The client secret in TN3159 must be issued by the original (transferring) team and signed with a Sign in with Apple private key that belongs to that team. The key doesn't have to be associated with the transferred App ID. You can create one on the original team like this:
- In Certificates, Identifiers & Profiles on the original team, register a new explicit App ID. A placeholder bundle ID is fine. Enable Sign in with Apple on it as a primary App ID.
- Create a new Sign in with Apple private key and associate it with that new App ID. Download the
.p8file and note the Key ID. - Build a client secret JWT with these values:
kid: the new Key IDiss: the original team's Team IDsub: the transferred app's bundle ID (theclient_idyou're migrating)
Thesubclaim has to match the transferring app's bundle ID or its associated Services ID.
2. Generating transfer identifiers (original team)
You can still generate transfer identifiers after the transfer. The original team can do this before the recipient accepts the transfer, or up to 60 days after acceptance. During that period the migration endpoints work for both teams.
- Call
POST https://appleid.apple.com/auth/tokenwith:
grant_type=client_credentialsscope=user.migrationclient_id=<transferred bundle ID>- the original team's client secret
This gives you an access token. There's no rate limit on this endpoint, so you can work in batches.
- For each stored user identifier, call
POST https://appleid.apple.com/auth/usermigrationinfowith:
sub=<original team-scoped user ID>target=<recipient Team ID>- the same
client_idand client secret
Record thetransfer_subfrom each response.
3. Exchanging transfer identifiers (recipient team)
- Get an access token with the recipient team's existing key and client secret, using the same
client_credentialsanduser.migrationrequest. - For each user, call
usermigrationinfowithtransfer_sub=<value>. The response contains the new team-scopedsuband, if the user chose a private relay address, the new private relayemail.
The original team's private relay addresses stop working for users who don't use another app from that team. If you need to contact users, do it before or during the migration.
4. Avoiding duplicate accounts
- Add the new
subto each account record as a separate column and keep the old identifier until you've checked the results. Don't overwrite it or create a new record. - During the 60 days after acceptance, identity tokens for migrated users who sign in contain both the new
suband atransfer_subclaim. When a sign-in has an unknownsub, look up the account bytransfer_subinstead of creating a new account. For users who don't sign in during that time, rely on the batch exchange. - On device,
getCredentialState(forUserID:)returns.transferredfor an old identifier. Your app can then silently re-authorize to get the new identifier. - Don't match accounts by email address. Private relay addresses are different for each team.
- Finish all exchanges before the 60 days run out. After that, identity tokens no longer contain
transfer_suband the exchange endpoint stops working.
5. If you miss the 60-day window
The supported recovery is to transfer the app back to the original team, generate the transfer identifiers there, then transfer it to the organization again. That restarts the migration period.
6. Original team's membership expiration
Our documentation doesn't say how an expired membership affects the migration endpoints or existing keys. You need an active membership on the original team to create the App ID and key in step 1, and a reverse transfer would also depend on that team's account. Keep the original team's membership active until every user has been migrated and verified.
If any usermigrationinfo call fails, file a report following the steps outlined in the forums post below:
Gathering required information for troubleshooting Sign in with Apple user migration
https://developer.apple.com/forums/thread/762829
Once submitted, please respond here with the Feedback ID.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer