---
title: "fetchItems(forIdentityVerificationSignature:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gklocalplayer/fetchitems(foridentityverificationsignature:)"
---

# fetchItems(forIdentityVerificationSignature:)

Generates a signature that you can use to authenticate the local player on your own server.

## Declaration

```swift
func fetchItems(forIdentityVerificationSignature completionHandler: (@Sendable (URL?, Data?, Data?, UInt64, (any Error)?) -> Void)? = nil)
```

```swift
func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64)
```

## Parameters

- `completionHandler`: A block that GameKit calls when the request completes. The block receives the following parameters:

## Mentioned in

Authenticating a player Initializing and configuring Game Center

## Discussion

Discussion Use this method when you need to authenticate with your server. To generate a signature for your authentication server, you perform steps in the game and pass data to the server, which completes the process. In your game, follow these steps: Call the fetchItems(forIdentityVerificationSignature:) method. Send the completion handler publicKeyURL, signature, salt, and timestamp parameters to your authentication server. Share the teamPlayerID and the bundle ID (see CFBundleIdentifier) with the server. For Apple Arcade games, share the gamePlayerID instead of the teamPlayerID. On the server, perform these steps: To mitigate replay attacks, make sure the timestamp parameter is recent, and to avoid high network overhead, respect the cache expiration headers. Download the public key using the publicKeyURL parameter. Verify with the appropriate signing authority that Apple signed the public key. Concatenate the following information into a data buffer in this order: the teamPlayerID (or gamePlayerID for Apple Arcade) property in UTF-8 format, the bundle ID in UTF-8 format, the timestamp parameter in big-endian UInt64 format, and the salt parameter. Use the public key to verify the signature of the concatenated data buffer using the RSASSA-PKCS1-v1_5 algorithm. If the generated and retrieved signatures match, GameKit authenticates the local player. important: Trust only the fields in the signed payload. Consider other data, such as nicknames, as player-provided information.

## See Also

### Authenticating the Local Player

- [authenticateHandler](gamekit/gklocalplayer/authenticatehandler.md)
- [isAuthenticated](gamekit/gklocalplayer/isauthenticated.md)
- [GKPlayerAuthenticationDidChangeNotificationName](foundation/nsnotification/name-swift.struct/gkplayerauthenticationdidchangenotificationname.md)
