Sign in with Apple migration after app transfer without a source-team key

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.

Answered by DTS Engineer in 920130022

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:

  1. 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.
  2. Create a new Sign in with Apple private key and associate it with that new App ID. Download the .p8 file and note the Key ID.
  3. Build a client secret JWT with these values:
  • kid: the new Key ID
  • iss: the original team's Team ID
  • sub: the transferred app's bundle ID (the client_id you're migrating)
    The sub claim 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.

  1. Call POST https://appleid.apple.com/auth/token with:
  • grant_type=client_credentials
  • scope=user.migration
  • client_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.
  1. For each stored user identifier, call POST https://appleid.apple.com/auth/usermigrationinfo with:
  • sub=<original team-scoped user ID>
  • target=<recipient Team ID>
  • the same client_id and client secret
    Record the transfer_sub from each response.

3. Exchanging transfer identifiers (recipient team)

  1. Get an access token with the recipient team's existing key and client secret, using the same client_credentials and user.migration request.
  2. For each user, call usermigrationinfo with transfer_sub=<value>. The response contains the new team-scoped sub and, if the user chose a private relay address, the new private relay email.

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 sub to 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 sub and a transfer_sub claim. When a sign-in has an unknown sub, look up the account by transfer_sub instead 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 .transferred for 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_sub and 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

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:

  1. 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.
  2. Create a new Sign in with Apple private key and associate it with that new App ID. Download the .p8 file and note the Key ID.
  3. Build a client secret JWT with these values:
  • kid: the new Key ID
  • iss: the original team's Team ID
  • sub: the transferred app's bundle ID (the client_id you're migrating)
    The sub claim 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.

  1. Call POST https://appleid.apple.com/auth/token with:
  • grant_type=client_credentials
  • scope=user.migration
  • client_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.
  1. For each stored user identifier, call POST https://appleid.apple.com/auth/usermigrationinfo with:
  • sub=<original team-scoped user ID>
  • target=<recipient Team ID>
  • the same client_id and client secret
    Record the transfer_sub from each response.

3. Exchanging transfer identifiers (recipient team)

  1. Get an access token with the recipient team's existing key and client secret, using the same client_credentials and user.migration request.
  2. For each user, call usermigrationinfo with transfer_sub=<value>. The response contains the new team-scoped sub and, if the user chose a private relay address, the new private relay email.

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 sub to 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 sub and a transfer_sub claim. When a sign-in has an unknown sub, look up the account by transfer_sub instead 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 .transferred for 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_sub and 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