> ## 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\*](/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 应用程序 ID 和 Web API 密钥。可从 Steamworks 网站上与你的应用 ID 关联的任何组的“权限”页面获取 Web API 密钥。如果这是用户首次使用 Steam 帐户登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并将其链接到所提供帐户的 Steam ID。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 Steam 帐户，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。另请参阅 ClientLinkSteamAccountAsync、ClientUnlinkSteamAccountAsync。异步任务完成后，调用 [PFAuthenticationLoginWithSteamGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresult) 获取结果。

## 要求

**头文件：** PFAuthentication.h

## 另请参阅

[PFAuthentication 成员](/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationLoginWithSteamGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresult.md)
- [PFAuthenticationLoginWithSteamGetResultSize](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithsteamgetresultsize.md)
- [快速入门 (Windows) - Core SDK 设置](/zh-CN/services/playfab/sdks/unified-sdk/quickstart-core.md)
- [服务 C API 概览 - PFAuthentication.h](/zh-CN/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [Win32 快速入门](/zh-CN/services/playfab/sdks/c/quickstart-win32.md)
