> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFAuthenticationAuthenticateGameServerWithCustomIdAsync

> Create a game_server entity token and return a new or existing game_server entity.

Create a game\_server entity token and return a new or existing game\_server entity.

## Syntax

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

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFAuthenticationAuthenticateCustomIdRequest\*](https://docs.xbox.com/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationauthenticatecustomidrequest.md)

Populated request object.

**`async`**   XAsyncBlock\*\
*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on Win32, Linux, and macOS. Create or return a game\_server entity token. Caller must be a title entity. When the asynchronous task is complete, call PFAuthenticationAuthenticateGameServerWithCustomIdGetResultSize and [PFAuthenticationAuthenticateGameServerWithCustomIdGetResult](https://docs.xbox.com/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationauthenticategameserverwithcustomidgetresult.md) to get the result.

## Requirements

**Header:** PFAuthentication.h

## See also

[PFAuthentication members](https://docs.xbox.com/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)


## Related topics

- [PFAuthenticationAuthenticateGameServerWithCustomIdGetResult](https://docs.xbox.com/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationauthenticategameserverwithcustomidgetresult.md)
- [Services C API overview - PFAuthentication.h](https://docs.xbox.com/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [Authenticate Game Server With Custom Id](https://docs.xbox.com/api-reference/authentication/authenticate-game-server-with-custom-id.md)
- [PFAuthenticationServerLoginWithServerCustomIdAsync](https://docs.xbox.com/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithservercustomidasync.md)
- [PFAuthenticationAuthenticateCustomIdRequest](https://docs.xbox.com/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationauthenticatecustomidrequest.md)
