AppleGameCenterAdapter

new AppleGameCenterAdapter(options, authData)

Parse Server Configuration

The following authData fields are required: id, publicKeyUrl, timestamp, signature, and salt. These fields are validated against the configured bundleId for additional security.

To configure Parse Server for Apple Game Center authentication, use the following structure:

{
 "auth": {
   "gcenter": {
    "bundleId": "com.valid.app"
 }
}

Insecure Authentication (Not Recommended)

The following authData fields are required for insecure authentication: id, publicKeyUrl, timestamp, signature, salt, and bundleId ([DEPRECATED]). This flow is insecure and poses potential security risks.

To configure Parse Server for insecure authentication, use the following structure:

{
  "auth": {
   "gcenter": {
     "enableInsecureAuth": true
  }
}

Deprecation Notice

The enableInsecureAuth option and authData.bundleId parameter are deprecated and may be removed in future releases. Use secure authentication with the bundleId configured in the options object instead.

Parameters:
NameTypeDescription
optionsObject

Configuration options for the adapter.

Properties
NameTypeAttributesDefaultDescription
bundleIdstring

Your Apple Game Center bundle ID. Required for secure authentication.

enableInsecureAuthboolean<optional>
false

[DEPRECATED] Enable insecure authentication (not recommended).

authDataObject

The authentication data provided by the client.

Properties
NameTypeAttributesDescription
idstring

The user ID obtained from Apple Game Center.

publicKeyUrlstring

The public key URL obtained from Apple Game Center.

timestampstring

The timestamp obtained from Apple Game Center.

signaturestring

The signature obtained from Apple Game Center.

saltstring

The salt obtained from Apple Game Center.

bundleIdstring<optional>

[DEPRECATED] The bundle ID obtained from Apple Game Center (required for insecure authentication).

Examples

Secure Authentication Example

// Example authData for secure authentication:
const authData = {
  gcenter: {
    id: "1234567",
    publicKeyUrl: "https://valid.apple.com/public/timeout.cer",
    timestamp: 1460981421303,
    salt: "saltST==",
    signature: "PoDwf39DCN464B49jJCU0d9Y0J"
  }
};

Insecure Authentication Example (Not Recommended)

// Example authData for insecure authentication:
const authData = {
  gcenter: {
    id: "1234567",
    publicKeyUrl: "https://valid.apple.com/public/timeout.cer",
    timestamp: 1460981421303,
    salt: "saltST==",
    signature: "PoDwf39DCN464B49jJCU0d9Y0J",
    bundleId: "com.valid.app" // Deprecated.
  }
};