> ## 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.

# 帳戶驗證和存取概觀

> 使用 XUserHandle、XBOX 驗證程式庫 (XAL) 和 XUser API，在 GDK 和跨平台遊戲中驗證 XBOX 玩家並管理身分識別。

使用本主題來驗證和存取帳戶、使用 XBOX 驗證程式庫 (XAL)，以及使用 `XUser` API 內容。

XBOX 用戶端會使用 `XUserHandle` 物件來管理與您遊戲互動之使用者的身分識別。每個 `XUserHandle` 執行個體都代表已登入您遊戲的使用者。

如需如何將使用者連線至 XBOX 服務的詳細資訊，請參閱[操作說明：登入使用者的最佳做法](/zh-TW/build/core-features/common/user/xuser_howto_best_practice_signing_in)中的程式碼範例。

## Windows PC 上的 XBOX 應用程式

對於 Windows PC 開發，您可以在開發沙箱中使用[測試帳戶](/zh-TW/services/xbox-services/develop/test-accounts/live-setup-testaccounts)，透過 XBOX 應用程式存取 XBOX 服務。使用下列步驟從開發沙箱存取測試帳戶。

1. [從 Microsoft Store](https://www.microsoft.com/store/productId/9MV0B5HZVK9Z) 下載並安裝 XBOX 應用程式。
2. 切換至您遊戲的開發沙箱。您可以使用 [PC 沙箱切換器](/zh-TW/tools/tools-services/live-pc-sandbox-switcher)工具，在 Windows PC 上切換開發沙箱。
3. 開啟 XBOX 應用程式。
4. 選取個人檔案圖示，然後選取 **Sign in**。
5. 依照指示存取帳戶。

若要登出帳戶，請開啟 XBOX 應用程式，然後選取個人檔案圖示 > **Sign out**。

## XAL 和 XUser

XAL 和 `XUser` 是類似的 API。提供 XAL 是為了支援跨平台遊戲。

<Note>如果您的目標是跨平台 (行動裝置和 GDK)，請使用 XAL。如果您的目標只有 GDK，請改用 `XUserHandle`。</Note>

## 另請參閱

[使用者身分識別和 XUser](/zh-TW/build/core-features/common/user/player-identity-xuser)


## Related topics

- [使用者登入](/zh-TW/services/xbox-services/fundamentals/identity/auth/live-authentication-nav.md)
- [驗證](/zh-TW/services/xbox-services/fundamentals/identity/auth/index.md)
- [PlayFab 的 Microsoft 帳戶驗證](/zh-TW/services/playfab/identity/dev-identity/authentication/aad-authentication.md)
- [Partner Center 功能概觀](/zh-TW/publishing/game-publishing/concepts/overview.md)
- [PlayFab API 的 Microsoft Entra ID 驗證](/zh-TW/services/playfab/identity/dev-identity/authentication/entra-id-api-authentication.md)
