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

# PFAuthenticationServerLoginWithXboxAsync

> Conecta o usuário usando um token do XBOX Live de um back-end de servidor externo, 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 um token do XBOX Live de um back-end de servidor externo, 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 PFAuthenticationServerLoginWithXboxAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const char* secretKey,  
    const PFAuthenticationServerLoginWithXboxRequest* 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`**   [PFAuthenticationServerLoginWithXboxRequest\*](/pt-BR/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithxboxrequest)

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 conta do XBOX Live 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. Consulte também ServerLinkXboxAccountAsync, ServerUnlinkXboxAccountAsync. Quando a tarefa assíncrona for concluída, chame [PFAuthenticationServerLoginWithXboxGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxgetresult) 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

- [PFAuthenticationServerLoginWithXboxGetResultSize](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxgetresultsize.md)
- [PFAuthenticationServerLoginWithXboxGetResult](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxgetresult.md)
- [Visão geral da API C do Services - PFAuthentication.h](/pt-BR/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationServerLoginWithXboxIdAsync](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxidasync.md)
- [PFAuthenticationServerLoginWithPSNAsync](/pt-BR/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithpsnasync.md)
