Method: accounts.signInWithGameCenter

Signs in or signs up a user with iOS Game Center credentials. If the sign-in succeeds, a new Identity Platform ID token and refresh token are issued for the authenticated user. The bundle ID is required in the request header as x-ios-bundle-identifier.

An API key is required in the request in order to identify the Google Cloud project.

HTTP request

POST https://identitytoolkit.googleapis.com/v1/accounts:signInWithGameCenter

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "playerId": string,
  "publicKeyUrl": string,
  "signature": string,
  "salt": string,
  "timestamp": string,
  "idToken": string,
  "displayName": string,
  "tenantId": string
}
Fields
playerId

string

Required. The user's Game Center player ID.

publicKeyUrl

string

Required. The URL to fetch the Apple public key in order to verify the given signature is signed by Apple.

signature

string

Required. The verification signature data generated by Apple.

salt

string

Required. A random string used to generate the given signature.

timestamp

string (int64 format)

Required. The time when the signature was created by Apple, in milliseconds since the epoch.

idToken

string

A valid ID token for an Identity Platform account. If present, this request will link the Game Center player ID to the account represented by this ID token.

displayName

string

The user's Game Center display name.

tenantId

string

The ID of the Identity Platform tenant the user is signing in to.

Response body

If successful, the response body contains data with the following structure:

Response message for accounts.signInWithGameCenter

JSON representation
{
  "localId": string,
  "playerId": string,
  "idToken": string,
  "refreshToken": string,
  "expiresIn": string,
  "isNewUser": boolean,
  "displayName": string
}
Fields
localId

string

The ID of the authenticated user. Always present in the response.

playerId

string

The user's Game Center player ID.

idToken

string

An Identity Platform ID token for the authenticated user.

refreshToken

string

An Identity Platform refresh token for the authenticated user.

expiresIn

string (int64 format)

The number of seconds until the ID token expires.

isNewUser

boolean

Whether the logged in user was created by this request.

displayName

string

Display name of the authenticated user.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.