> ## 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-TW/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithbattlenetrequest)

已填入的要求物件。

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

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 適用於 Windows。另請參閱 ServerLinkBattleNetAccountAsync、ServerUnlinkBattleNetAccountAsync。非同步工作完成時，請呼叫 [PFAuthenticationServerLoginWithBattleNetGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresult) 以取得結果。

## 需求

**標頭：** PFAuthentication.h

## 另請參閱

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


## Related topics

- [PFAuthenticationServerLoginWithBattleNetGetResultSize](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresultsize.md)
- [PFAuthenticationServerLoginWithBattleNetGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithbattlenetgetresult.md)
- [服務 C API 概觀 - PFAuthentication.h](/zh-TW/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationServerLoginWithBattleNetRequest](/zh-TW/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithbattlenetrequest.md)
- [PFAuthenticationLoginWithBattleNetAsync](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithbattlenetasync.md)
