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

# PFAuthenticationLoginWithCustomIDAsync

> 使用遊戲所產生的自訂唯一識別碼讓使用者登入，並傳回工作階段識別碼，之後可用於 API 呼叫。

使用遊戲所產生的自訂唯一識別碼讓使用者登入，並傳回工作階段識別碼，之後可用於需要已驗證使用者的 API 呼叫

## 語法

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

### 參數

**`serviceConfigHandle`**   PFServiceConfigHandle

從 PFServiceConfigCreateHandle 呼叫傳回的 PFServiceConfigHandle。

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

已填入的要求物件。

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

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 適用於所有平台。強烈建議開發人員確保客戶極不可能產生已被其他客戶使用的識別碼。如果這是使用者第一次使用 Custom ID 登入，且 CreateAccount 設定為 true，將會建立新的 PlayFab 帳戶並連結到該 Custom ID。在此情況下，不會有任何電子郵件或使用者名稱與 PlayFab 帳戶相關聯。否則，如果沒有任何 PlayFab 帳戶連結到該 Custom ID，將會傳回表示此情況的錯誤，讓遊戲可以引導使用者建立 PlayFab 帳戶。另請參閱 ClientLinkCustomIDAsync、ClientUnlinkCustomIDAsync。非同步工作完成時，呼叫 [PFAuthenticationLoginWithCustomIDGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithcustomidgetresult) 以取得結果。

## 需求

**標頭：** PFAuthentication.h

## 另請參閱

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


## Related topics

- [PFAuthenticationLoginWithCustomIDGetResultSize](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithcustomidgetresultsize.md)
- [PFAuthenticationLoginWithCustomIDGetResult](/zh-TW/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithcustomidgetresult.md)
- [服務 C API 概觀 - PFAuthentication.h](/zh-TW/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [Android 快速入門](/zh-TW/services/playfab/sdks/c/quickstart-android.md)
- [Linux 快速入門](/zh-TW/services/playfab/sdks/c/quickstart-linux.md)
