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

# PFAuthenticationServerLoginWithXboxIdAsync

> Conecta o usuário usando uma XBOX ID e uma Sandbox ID, retornando um identificador de sessão que pode ser usado posteriormente para chamadas de API que exigem um usuário autenticado.

Conecta o usuário usando uma XBOX ID e uma Sandbox ID, retornando um identificador de sessão que pode ser usado posteriormente para chamadas de API que exigem um usuário autenticado

## Sintaxe

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

### Parâmetros

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigHandle retornado pela chamada PFServiceConfigCreateHandle.

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

Chave secreta do título usada para autenticar a solicitação de serviço.

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

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 Win32, Linux e macOS. Se esta for a primeira vez que um usuário entra com a XBOX ID e CreateAccount estiver definido como true, uma nova conta do PlayFab será criada e vinculada à conta do XBOX Live. Nesse caso, nenhum email ou nome de usuário será associado à conta do PlayFab. Caso contrário, se nenhuma conta do PlayFab estiver vinculada à conta do XBOX Live, será retornado um erro indicando isso, para que o título possa orientar o usuário na criação de uma conta do PlayFab. Quando a tarefa assíncrona for concluída, chame [PFAuthenticationServerLoginWithXboxIdGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxidgetresult) 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

- [PFAuthenticationServerLoginWithXboxIdGetResultSize](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxidgetresultsize.md)
- [PFAuthenticationServerLoginWithXboxIdGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxidgetresult.md)
- [Visão geral da API C do Services - PFAuthentication.h](/pt-BR/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationServerLoginWithServerCustomIdAsync](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithservercustomidasync.md)
- [PFAuthenticationServerLoginWithSteamIdAsync](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithsteamidasync.md)
