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

# PFAuthenticationLoginWithGooglePlayGamesServicesAsync

> Signs the user in using their Google Play Games account credentials

Signs the user in using their Google Play Games account credentials

## Syntax

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

### Parameters

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigHandle returned from PFServiceConfigCreateHandle call.

**`request`**   [PFAuthenticationLoginWithGooglePlayGamesServicesRequest\*](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleplaygamesservicesrequest)

Populated request object.

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

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on Android. Google Play Games sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google Play Games sign-in for Android APIs on the device and passing it to this API. If this is the first time a user has signed in with the Google Play Games account and CreateAccount is set to true, a new PlayFab account will be created and linked to the Google Play Games account. Otherwise, if no PlayFab account is linked to the Google Play Games account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. The current (recommended) method for obtaining a Google Play Games account credential in an Android application is to call GamesSignInClient.requestServerSideAccess() and send the auth code as the ServerAuthCode parameter of this API. Before doing this, you must create an OAuth 2.0 web application client ID in the Google API Console and configure its client ID and secret in the PlayFab Game Manager Google Add-on for your title. This method does not require prompting of the user for additional Google account permissions, resulting in a user experience with the least possible friction. For more information about obtaining the server auth code, see [https://developers.google.com/games/services/android/signin](https://developers.google.com/games/services/android/signin). When the asynchronous task is complete, call [PFAuthenticationLoginWithGooglePlayGamesServicesGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresult) to get the result.

## Requirements

**Header:** PFAuthentication.h

## See also

[PFAuthentication members](/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationLoginWithGooglePlayGamesServicesGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresult.md)
- [PFAuthenticationLoginWithGooglePlayGamesServicesGetResultSize](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresultsize.md)
- [Services C API overview - PFAuthentication.h](/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationReLoginWithGooglePlayGamesServicesAsync](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithgoogleplaygamesservicesasync.md)
- [PFAuthenticationLoginWithGooglePlayGamesServicesRequest](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleplaygamesservicesrequest.md)
