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

# PFAuthenticationLoginWithSteamAsync

> 使用 Steam 驗證票證將使用者登入，並傳回工作階段識別碼，之後可用於需要已驗證使用者的 API 呼叫。

使用 Steam 驗證票證將使用者登入，並傳回工作階段識別碼，之後可用於需要已驗證使用者的 API 呼叫

## 語法

```cpp theme={null}
HRESULT PFAuthenticationLoginWithSteamAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const PFAuthenticationLoginWithSteamRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`serviceConfigHandle`**   PFServiceConfigHandle

從 PFServiceConfigCreateHandle 呼叫傳回的 PFServiceConfigHandle。

**`request`**   [PFAuthenticationLoginWithSteamRequest\*](/zh-TW/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithsteamrequest)

已填入資料的要求物件。

**`async`**   XAsyncBlock\*<br />*Inout*

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 可在 Win32、Linux 和 macOS 上使用。Steam 登入是透過 Steam 工作階段票證完成的。如需票證的詳細資訊，請參閱 Steamworks SDK：[https://partner.steamgames.com/documentation/auth](https://partner.steamgames.com/documentation/auth)。注意：若要讓 Steam 驗證運作，必須在 PlayFab Game Manager 中 (位於附加元件市集的 Steam 底下) 為遊戲設定 Steam 應用程式識別碼和 Web API 金鑰。您可以在 Steamworks 網站中，從與您的 App ID 相關聯的任何群組的「權限」頁面取得 Web API 金鑰。如果這是使用者第一次以 Steam 帳戶登入，且 CreateAccount 設為 true，系統將建立新的 PlayFab 帳戶，並將其連結至所提供帳戶的 Steam ID。在此情況下，PlayFab 帳戶不會與任何電子郵件或使用者名稱相關聯。否則，如果沒有任何 PlayFab 帳戶連結至該 Steam 帳戶，將會傳回表示此情況的錯誤，讓遊戲可以引導使用者建立 PlayFab 帳戶。另請參閱 ClientLinkSteamAccountAsync、ClientUnlinkSteamAccountAsync。非同步工作完成時，請呼叫 [PFAuthenticationLoginWithSteamGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresult) 以取得結果。

## 需求

**標頭：** PFAuthentication.h

## 另請參閱

[PFAuthentication 成員](/zh-TW/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationLoginWithSteamGetResultSize](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresultsize.md)
- [PFAuthenticationLoginWithSteamGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresult.md)
- [快速入門 (Windows) - Core SDK 設定](/zh-TW/services/playfab/sdks/unified-sdk/quickstart-core.md)
- [Win32 快速入門](/zh-TW/services/playfab/sdks/c/quickstart-win32.md)
- [服務 C API 概觀 - PFAuthentication.h](/zh-TW/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
