Sign in with Apple for games
Before you start
Section titled “Before you start”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.
In the Dashboard
Section titled “In the Dashboard”Choose an environment in the header, open Project settings → Authentication and add an Apple connection.
| Field | Meaning |
|---|---|
Client ids | The bundle id of the app and the service id of the web app, comma separated. |
In the game
Section titled “In the game”The game sends the identity token of the Apple credential.
TypeScript
Section titled “TypeScript”import { Session } from '@rudder/sdk';
const session = await Session.signIn(key, { provider: 'apple', payload: { idToken },});C# and Unity
Section titled “C# and Unity”using RudderSdk;
var session = await Session.SignInAsync(key, new ProviderSignIn{ Provider = "apple", Payload = new Dictionary<string, object?> { ["idToken"] = idToken },});What the platform checks
Section titled “What the platform checks”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.
Errors
Section titled “Errors”- 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.