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

# PFAuthenticationGetEntityWithSecretKeyAsync

> Obtém um Entity Token passando um PFServiceConfigHandle e uma Secret Key do título. Se for bem-sucedida, emite um novo token de entidade e um evento do PlayStream.

Método para trocar um AuthenticationTicket herdado ou a SecretKey do título por um Entity Token ou para atualizar um Entity Token ainda válido.

## Sintaxe

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

### Parâmetros

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigHandle retornado pela chamada de PFServiceConfigCreateHandle.

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

Secret Key do título usada para autenticar a solicitação de serviço.

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

Objeto de solicitação preenchido.

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

XAsyncBlock para a operação assíncrona.

### Valor de retorno

Tipo: HRESULT

Código de resultado desta operação de API.

## Comentários

Esta API está disponível no Windows, Linux e macOS. Esta API deve ser chamada com os cabeçalhos X-SecretKey, X-Authentication ou X-EntityToken. O cabeçalho ainda deve ser válido e não pode estar expirado nem revogado. Se for bem-sucedida, ela emitirá um novo token de entidade e o evento 'entity\_logged\_in' do PlayStream. Quando a tarefa assíncrona for concluída, chame [PFAuthenticationGetEntityWithSecretKeyGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeygetresult) para obter o resultado.

## Requisitos

**Cabeçalho:** PFAuthentication.h

## Confira também

[Membros de PFAuthentication](/pt-BR/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationGetEntityWithSecretKeyGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationgetentitywithsecretkeygetresult.md)
- [PFSegmentsServerGetAllSegmentsAsync](/pt-BR/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetallsegmentsasync.md)
- [PFTitleDataManagementServerGetTimeAsync](/pt-BR/services/playfab/api-references/c/pftitledatamanagement/functions/pftitledatamanagementservergettimeasync.md)
- [PFSegmentsServerGetPlayerSegmentsAsync](/pt-BR/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetplayersegmentsasync.md)
- [PFSegmentsServerGetPlayerTagsAsync](/pt-BR/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetplayertagsasync.md)
