Sign in with Apple - Exchange Identifiers - Request is invalid

Viewed 365

We try to exchange 'Sign in with apple' between 2 teams, we proceed as follows:

The old team generates a transfer_sub for the new team, the request (https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team) here looks like this:

curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "sub=$oldUserSub&target=$newTeamId&client_id=$oldAppBundleID&client_secret=$oldSecret"

This works perfectly, the old team receives a transfer_sub and gives it to the new team.

{"transfer_sub":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}

The new team gets the new ID with the following request (https://developer.apple.com/documentation/sign_in_with_apple/bringing_new_apps_and_users_into_your_team):

curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "transfer_sub=$transferSubFromOldTeam&client_id=$newAppBundleID&client_secret=$newSecret"

Unfortunately this does not work because there is an error return:

{"error":"invalid_request"}

Does anyone have an idea what to do to make the relegation valid?

1 Answers

Have you already transferred your app?

The same issue has already been resolved in the Developer Forums.

Referring to here may resolve this issue.

The answer says:

You cannot use the api "/auth/usermigrationinfo" of the URL before app transfer.

So, If you haven't transferred your app yet, you have to complete your app transfer first. Then the new team will be able to get the new ID with the following request:

curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "transfer_sub=$transferSubFromOldTeam&client_id=$newAppBundleID&client_secret=$newSecret"
Related