Bringing new apps and users into your team

Hi.

I transfered an app that uses apple login.

but, I didn't do the Transferring your apps and users to another team process,

So, I'm working on Bringing new apps and users into your team.

Is it possible to transfer a user with just Bringing new apps and users into your team.?


I'm having trouble with the part where I get the access_token from the Bringing new apps and users into your team. action.

I've only entered it with the NEW TEAM's information.

POST /auth/token HTTP/1.1
Host: appleid.apple.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=user.migration&client_id={client_id}&client_secret={client_secret}

client_id : APP bundle ID

client_secret : Created by referencing [Create the client secret] in Generate and validate tokens.

require 'jwt'

key_file = 'key.p8'
team_id = 'TeamID'
client_id = 'AppID'
key_id = 'KeyID'

ecdsa_key = OpenSSL::PKey::EC.new IO.read key_file

headers = {
 'kid' => key_id
}

claims = {
'iss' => team_id,
'iat' => Time.now.to_i,
'exp' => Time.now.to_i + 86400*180,
'aud' => 'https://appleid.apple.com',
'sub' => client_id,
}

token = JWT.encode claims, ecdsa_key, 'ES256', headers

puts token

POST /auth/token HTTP/1.1
Host: appleid.apple.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=user.migration&client_id={client_id}&client_secret={client_secret}
{
  "error": "invalid_client"
}

Thank you.