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 |
Required. The user's Game Center player ID. |
publicKeyUrl |
Required. The URL to fetch the Apple public key in order to verify the given signature is signed by Apple. |
signature |
Required. The verification signature data generated by Apple. |
salt |
Required. A random string used to generate the given signature. |
timestamp |
Required. The time when the signature was created by Apple, in milliseconds since the epoch. |
idToken |
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 |
The user's Game Center display name. |
tenantId |
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 |
The ID of the authenticated user. Always present in the response. |
playerId |
The user's Game Center player ID. |
idToken |
An Identity Platform ID token for the authenticated user. |
refreshToken |
An Identity Platform refresh token for the authenticated user. |
expiresIn |
The number of seconds until the ID token expires. |
isNewUser |
Whether the logged in user was created by this request. |
displayName |
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.