<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKLocalPlayer/authenticateHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKLocalPlayer(py)authenticateHandler"
  },
  "title" : "authenticateHandler"
}
-->

# authenticateHandler

A handler that GameKit calls while initializing the local player.

```
var authenticateHandler: ((NSViewController?, (any Error)?) -> Void)? { get set }
```

## Parameters

`viewController`

A view controller that your game presents to the local player so they can perform any necessary actions to finish initialization, or `nil` if the initialization process is complete.

`error`

Describes an error if it occurs, or `nil` if the operation completes.

## Discussion

Before you can access any Game Center data and use GameKit features, you need to initialize the local player to ensure the player signs in to Game Center on the device running your game. Set this property to a method that GameKit invokes during the initialization process. If `viewController` is `nil`, Game Center initializes the player and the player can start your game. Otherwise, present the view controller so the player can perform any additional actions to complete the process.

Game Center may show a brief initialization screen if the player isn’t already signed into Game Center.

For more information about initializing Game Center with a local player, see [Authenticating a player](/documentation/GameKit/authenticating-a-player).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)