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

# PFAuthenticationGetEntityAsync

> 使用 PFEntityHandle 進行驗證，以舊版 AuthenticationTicket 或遊戲 SecretKey 交換 Entity Token，或重新整理仍然有效的 Entity Token。

以舊版 AuthenticationTicket 或遊戲 SecretKey 交換 Entity Token，或重新整理仍然有效之 Entity Token 的方法。

## 語法

```cpp theme={null}
HRESULT PFAuthenticationGetEntityAsync(  
    PFEntityHandle entityHandle,  
    const PFAuthenticationGetEntityRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`entityHandle`**   PFEntityHandle

用於驗證的 PFEntityHandle。

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

已填入的要求物件。

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

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 適用於 Windows、Linux 和 macOS。呼叫此 API 時必須使用 X-SecretKey、X-Authentication 或 X-EntityToken 標頭。標頭必須仍然有效，且不能已過期或已撤銷。如果成功，將會核發新的實體權杖，並發出 'entity\_logged\_in' PlayStream 事件。非同步工作完成時，呼叫 [PFAuthenticationGetEntityGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitygetresult) 以取得結果。

## 需求

**標頭：** PFAuthentication.h

## 另請參閱

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


## Related topics

- [PFAuthenticationGetEntityGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitygetresult.md)
- [PlayFab Services C/C++ SDK 版本資訊](/zh-TW/services/playfab/release-notes/playfab-c/index.md)
- [服務 C API 概觀 - PFAuthentication.h](/zh-TW/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationGetEntityWithSecretKeyAsync](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeyasync.md)
- [PFAuthenticationValidateEntityTokenAsync](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationvalidateentitytokenasync.md)
