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

# PFAuthenticationServerLoginWithBattleNetAsync

> 使用 Battle.net 身份令牌为用户登录的服务器 API，使用游戏密钥对服务请求进行身份验证。可在 Windows 上使用。

使用 Battle.net 身份令牌为用户登录

## 语法

```cpp theme={null}
HRESULT PFAuthenticationServerLoginWithBattleNetAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const char* secretKey,  
    const PFAuthenticationServerLoginWithBattleNetRequest* request,  
    XAsyncBlock* async  
)  
```

### 参数

**`serviceConfigHandle`**   PFServiceConfigHandle

从 PFServiceConfigCreateHandle 调用返回的 PFServiceConfigHandle。

**`secretKey`**   char\*<br />*In\_z*

用于对服务请求进行身份验证的游戏密钥。

**`request`**   [PFAuthenticationServerLoginWithBattleNetRequest\*](/zh-CN/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithbattlenetrequest)

已填充的请求对象。

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

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

此 API 可在 Windows 上使用。另请参阅 ServerLinkBattleNetAccountAsync、ServerUnlinkBattleNetAccountAsync。异步任务完成后，调用 [PFAuthenticationServerLoginWithBattleNetGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresult) 获取结果。

## 要求

**头文件：** PFAuthentication.h

## 另请参阅

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


## Related topics

- [PFAuthenticationServerLoginWithBattleNetGetResultSize](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresultsize.md)
- [PFAuthenticationServerLoginWithBattleNetGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresult.md)
- [PFAuthenticationServerLoginWithBattleNetRequest](/zh-CN/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithbattlenetrequest.md)
- [PFAuthenticationLoginWithBattleNetAsync](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithbattlenetasync.md)
- [PFAuthenticationReLoginWithBattleNetAsync](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithbattlenetasync.md)
