Skip to content

Sign in with Apple for games

A Service ID in the Apple Developer portal, with the host of the game among its return URLs, and the bundle id of the app. The game gets the identity token from Sign in with Apple, in the browser or through the native framework.

Choose an environment in the header, open Project settings → Authentication and add an Apple connection.

FieldMeaning
Client idsThe bundle id of the app and the service id of the web app, comma separated.

The game sends the identity token of the Apple credential.

import { Session } from '@rudder/sdk';
const session = await Session.signIn(key, {
provider: 'apple',
payload: { idToken },
});
using RudderSdk;
var session = await Session.SignInAsync(key, new ProviderSignIn
{
Provider = "apple",
Payload = new Dictionary<string, object?> { ["idToken"] = idToken },
});

The signature against the keys of appleid.apple.com, the issuer, the audience against your client ids, and the expiry. The player is the sub of the token, which is the same for every app of your Apple team and never changes for the same account.

Apple sends the name of the account only in the answer of the first authorization, not in the token, so a nickname comes from the game or from the profile of the player instead.

  • A token of another app or another team answers 401 unauthorized.
  • Apple not answering its keys answers 503 try_again.

The rest are in Errors.