> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 服务 C API 概览 - PFAuthenticationTypes.h

> 服务 C API 概览 - PFAuthenticationTypes.h

## 结构

| 结构                                                                                                                                                                                  | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PFAuthenticationAuthenticateCustomIdRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationauthenticatecustomidrequest)                         | PFAuthenticationAuthenticateCustomIdRequest 数据模型。创建或返回 game\_server 实体令牌。调用方必须是游戏实体。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [PFAuthenticationAuthenticateCustomIdResult](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationauthenticatecustomidresult)                           | PFAuthenticationAuthenticateCustomIdResult 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [PFAuthenticationDeleteRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationdeleterequest)                                                     | PFAuthenticationDeleteRequest 数据模型。删除 game\_server 实体。调用方可以是尝试删除自身的 game\_server 实体，也可以是尝试为该游戏删除 game\_server 实体的游戏实体。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [PFAuthenticationEntityTokenResponse](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationentitytokenresponse)                                         | PFAuthenticationEntityTokenResponse 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [PFAuthenticationGetEntityRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationgetentityrequest)                                               | PFAuthenticationGetEntityRequest 数据模型。此 API 必须使用 X-SecretKey、X-Authentication 或 X-EntityToken 标头调用。可以包含可选的 EntityKey，以尝试将所生成的 EntityToken 设置为特定实体，但该实体必须与调用方存在关联，例如角色的 master\_player\_account。如果发送 X-EntityToken，帐户将被标记为刚刚登录，并将颁发新令牌。如果使用 X-Authentication 或 X-EntityToken，该标头必须仍然有效，不能过期或被吊销。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [PFAuthenticationLoginResult](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginresult)                                                         | PFAuthenticationLoginResult 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [PFAuthenticationLoginWithAppleRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithapplerequest)                                     | PFAuthenticationLoginWithAppleRequest 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [PFAuthenticationLoginWithCustomIDRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithcustomidrequest)                               | PFAuthenticationLoginWithCustomIDRequest 数据模型。强烈建议开发人员确保客户生成的 ID 极不可能与其他客户正在使用的 ID 相同。如果这是用户首次使用自定义 ID 登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该自定义 ID。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该自定义 ID，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [PFAuthenticationLoginWithFacebookRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithfacebookrequest)                               | PFAuthenticationLoginWithFacebookRequest 数据模型。使用 Facebook 用户访问令牌完成 Facebook 登录。有关该令牌的更多信息，请参阅 Facebook 开发人员文档 ([https://developers.facebook.com/docs/facebook-login/access-tokens/](https://developers.facebook.com/docs/facebook-login/access-tokens/))。例如，在 Unity 中，可从 Facebook SDK ScriptableObject FB 中的 AccessToken 获取该令牌。如果这是用户首次使用 Facebook 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到所提供帐户的 Facebook ID。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 Facebook 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。请注意，游戏不应在不同的 PlayFab 游戏 ID 之间重复使用相同的 Facebook 应用程序，因为 Facebook 为每个应用程序提供唯一的用户 ID，这样做可能会导致玩家在其 PlayFab 帐户信息中的 Facebook ID 出现问题。如果必须在新的 PlayFab 游戏 ID 中重复使用某个应用程序，请务必先从 Facebook 取消所有帐户的链接，或删除第一个游戏 ID 中的所有用户。注意：如果用户使用 AuthenticationToken 而不是 AccessToken 进行身份验证，则 GetFriendsList API 将返回空列表。                                                                                                                                                                                                                                                    |
| [PFAuthenticationLoginWithGameCenterRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgamecenterrequest)                           | PFAuthenticationLoginWithGameCenterRequest 数据模型。Game Center 玩家标识符 ([https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/index.html#](https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/index.html#) // apple\_ref/occ/instp/ACAccount/identifier) 是存储在本地设备上的生成字符串。与设备标识符一样，必须注意不要将玩家的 Game Center 标识符暴露给最终用户，否则可能会导致用户的帐户遭到破坏。如果这是用户首次使用 Game Center 登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 Game Center 标识符。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 Game Center 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。如果使用了无效的 iOS Game Center 玩家标识符，将返回相应的错误。                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [PFAuthenticationLoginWithGoogleAccountRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleaccountrequest)                     | PFAuthenticationLoginWithGoogleAccountRequest 数据模型。通过使用设备上的 Google Android 版登录 API 获取 Google OAuth 2.0 凭据并将其传递给此 API，可完成 Google 登录。如果这是用户首次使用 Google 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 Google 帐户。否则，如果没有 PlayFab 帐户链接到该 Google 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。目前（推荐）在 Android 应用程序中获取 Google 帐户凭据的方法是调用 GoogleSignInAccount.getServerAuthCode()，并将授权代码作为此 API 的 ServerAuthCode 参数发送。执行此操作之前，必须在 Google API 控制台中创建 OAuth 2.0 Web 应用程序客户端 ID，并在游戏的 PlayFab Game Manager Google 加载项中配置其客户端 ID 和密钥。此方法不需要向用户提示其他 Google 帐户权限，可最大限度地减少用户体验中的摩擦。有关获取服务器授权代码的更多信息，请参阅 [https://developers.google.com/identity/sign-in/android/offline-access](https://developers.google.com/identity/sign-in/android/offline-access)。之前（已弃用）的方法是通过在客户端上调用 GetAccessToken() 来获取 OAuth 访问令牌，并将其作为 AccessToken 参数传递给此 API，用于 Google OAuth 2.0 访问令牌。有关此更改的更多信息，请参阅 Google 开发人员文档 ([https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html](https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html))。 |
| [PFAuthenticationLoginWithGooglePlayGamesServicesRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleplaygamesservicesrequest) | PFAuthenticationLoginWithGooglePlayGamesServicesRequest 数据模型。通过使用设备上的 Google Play Games Android 版登录 API 获取 Google OAuth 2.0 凭据并将其传递给此 API，可完成 Google Play Games 登录。如果这是用户首次使用 Google Play Games 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 Google Play Games 帐户。否则，如果没有 PlayFab 帐户链接到该 Google Play Games 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。目前（推荐）在 Android 应用程序中获取 Google Play Games 帐户凭据的方法是调用 GamesSignInClient.requestServerSideAccess()，并将授权代码作为此 API 的 ServerAuthCode 参数发送。执行此操作之前，必须在 Google API 控制台中创建 OAuth 2.0 Web 应用程序客户端 ID，并在游戏的 PlayFab Game Manager Google 加载项中配置其客户端 ID 和密钥。此方法不需要向用户提示其他 Google 帐户权限，可最大限度地减少用户体验中的摩擦。有关获取服务器授权代码的更多信息，请参阅 [https://developers.google.com/games/services/android/signin](https://developers.google.com/games/services/android/signin)。                                                                                                                                                                                                                                                                              |
| [PFAuthenticationLoginWithNintendoServiceAccountRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithnintendoserviceaccountrequest)   | PFAuthenticationLoginWithNintendoServiceAccountRequest 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [PFAuthenticationLoginWithOpenIdConnectRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithopenidconnectrequest)                     | PFAuthenticationLoginWithOpenIdConnectRequest 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [PFAuthenticationLoginWithPSNRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithpsnrequest)                                         | PFAuthenticationLoginWithPSNRequest 数据模型。如果这是用户首次使用 PlayStation :tm: Network 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 PlayStation :tm: Network 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 PlayStation :tm: Network 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [PFAuthenticationLoginWithServerCustomIdRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithservercustomidrequest)                   | PFAuthenticationLoginWithServerCustomIdRequest 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [PFAuthenticationLoginWithSteamIdRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithsteamidrequest)                                 | PFAuthenticationLoginWithSteamIdRequest 数据模型。如果这是用户首次使用 Steam ID 登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 Steam 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 Steam 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。未登录到 Steam 客户端应用的 Steam 用户仅会同步其 Steam 用户名，其他数据（例如货币和国家/地区）在客户端打开并登录之前不可用。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [PFAuthenticationLoginWithSteamRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithsteamrequest)                                     | PFAuthenticationLoginWithSteamRequest 数据模型。使用 Steam 会话票证完成 Steam 登录。有关该票证的更多信息，请参阅 Steamworks SDK：[https://partner.steamgames.com/documentation/auth](https://partner.steamgames.com/documentation/auth)。注意：要使 Steam 身份验证正常工作，必须在 PlayFab Game Manager 中（在加载项 Marketplace 的 Steam 下）为游戏配置 Steam 应用程序 ID 和 Web API 密钥。可从 Steamworks 站点上与您的应用 ID 关联的任何组的“权限”页面获取 Web API 密钥。如果这是用户首次使用 Steam 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到所提供帐户的 Steam ID。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 Steam 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [PFAuthenticationLoginWithXboxIdRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithxboxidrequest)                                   | PFAuthenticationLoginWithXboxIdRequest 数据模型。如果这是用户首次使用 XBOX ID 登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 XBOX Live 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 XBOX Live 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [PFAuthenticationLoginWithXboxRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithxboxrequest)                                       | PFAuthenticationLoginWithXboxRequest 数据模型。如果这是用户首次使用 XBOX Live 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 XBOX Live 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 XBOX Live 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [PFAuthenticationLoginWithXUserRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithxuserrequest)                                     | PFAuthenticationLoginWithXUserRequest 数据模型。如果这是用户首次使用 XBOX Live 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 XBOX Live 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 XBOX Live 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。用于 PFAuthenticationLoginWithXUserAsync 的请求对象。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [PFAuthenticationServerLoginWithXboxRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithxboxrequest)                           | PFAuthenticationServerLoginWithXboxRequest 数据模型。如果这是用户首次使用 XBOX Live 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该 XBOX Live 帐户。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 XBOX Live 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [PFAuthenticationUserSettings](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationusersettings)                                                       | PFAuthenticationUserSettings 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [PFAuthenticationValidateEntityTokenRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationvalidateentitytokenrequest)                           | PFAuthenticationValidateEntityTokenRequest 数据模型。在给定实体令牌的情况下，验证该令牌未过期或被吊销，并返回所有者的详细信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [PFAuthenticationValidateEntityTokenResponse](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationvalidateentitytokenresponse)                         | PFAuthenticationValidateEntityTokenResponse 数据模型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

## 状态更改

| 状态更改 | 说明 |
| ---- | -- |

## 枚举

| 枚举                                                                                                                                          | 说明                       |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| [PFAuthenticationIdentifiedDeviceType](/services/playfab/api-references/c/pfauthenticationtypes/enums/pfauthenticationidentifieddevicetype) | IdentifiedDeviceType 枚举。 |


## Related topics

- [服务 C API 概览 - PFAuthentication.h](/zh-CN/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [服务 C API 概览 - PFTypes.h](/zh-CN/services/playfab/api-references/c/pftypes/pftypes_members.md)
- [服务 C API 概览 - PFStatisticsTypes.h](/zh-CN/services/playfab/api-references/c/pfstatisticstypes/pfstatisticstypes_members.md)
- [服务 C API 概览 - PFLeaderboardsTypes.h](/zh-CN/services/playfab/api-references/c/pfleaderboardstypes/pfleaderboardstypes_members.md)
- [服务 C API 概览 - PFInventoryTypes.h](/zh-CN/services/playfab/api-references/c/pfinventorytypes/pfinventorytypes_members.md)
