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

# PFAuthenticationLoginWithGoogleAccountAsync

> Google 계정 자격 증명을 사용하여 사용자를 로그인합니다.

Google 계정 자격 증명을 사용하여 사용자를 로그인합니다.

## Syntax

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

### Parameters

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigCreateHandle 호출에서 반환된 PFServiceConfigHandle입니다.

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

값이 채워진 요청 객체입니다.

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

비동기 작업을 위한 XAsyncBlock입니다.

### Return value

Type: HRESULT

이 API 작업의 결과 코드입니다.

## Remarks

이 API는 Android에서 사용할 수 있습니다. Google 로그인은 디바이스에서 Android용 Google 로그인 API를 사용하여 Google OAuth 2.0 자격 증명을 얻고 이를 이 API에 전달하여 수행됩니다. 사용자가 Google 계정으로 처음 로그인하고 CreateAccount가 true로 설정된 경우, 새 PlayFab 계정이 생성되고 Google 계정에 연결됩니다. 그렇지 않고 Google 계정에 연결된 PlayFab 계정이 없는 경우, 이를 나타내는 오류가 반환되어 타이틀이 사용자에게 PlayFab 계정 생성을 안내할 수 있습니다. Android 애플리케이션에서 Google 계정 자격 증명을 얻는 현재(권장) 방법은 GoogleSignInAccount.getServerAuthCode()를 호출하고 인증 코드를 이 API의 ServerAuthCode 매개 변수로 전송하는 것입니다. 이렇게 하기 전에 Google API Console에서 OAuth 2.0 웹 애플리케이션 클라이언트 ID를 만들고 타이틀에 대한 PlayFab Game Manager Google 추가 기능에서 해당 클라이언트 ID와 비밀을 구성해야 합니다. 이 방법은 사용자에게 추가 Google 계정 권한을 요청할 필요가 없으므로 가능한 한 최소의 마찰로 사용자 경험을 제공합니다. 서버 인증 코드를 얻는 방법에 대한 자세한 내용은 [https://developers.google.com/identity/sign-in/android/offline-access](https://developers.google.com/identity/sign-in/android/offline-access)를 참조하세요. 이전(더 이상 사용되지 않음) 방법은 클라이언트에서 GetAccessToken()을 호출하여 OAuth 액세스 토큰을 얻고 이를 이 API에 AccessToken 매개 변수로 전달하여 Google OAuth 2.0 액세스 토큰과 함께 사용하는 것이었습니다. 이 변경 사항에 대한 자세한 내용은 Google 개발자 설명서([https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html](https://android-developers.googleblog.com/2016/01/play-games-permissions-are-changing-in.html))에서 확인할 수 있습니다. 비동기 작업이 완료되면 [PFAuthenticationLoginWithGoogleAccountGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountgetresult)를 호출하여 결과를 가져오세요.

## Requirements

**Header:** PFAuthentication.h

## See also

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


## Related topics

- [PFAuthenticationLoginWithGoogleAccountGetResultSize](/ko/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountgetresultsize.md)
- [PFAuthenticationLoginWithGoogleAccountGetResult](/ko/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountgetresult.md)
- [Services C API 개요 - PFAuthentication.h](/ko/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationReLoginWithGoogleAccountAsync](/ko/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithgoogleaccountasync.md)
- [PFAuthenticationLoginWithGoogleAccountRequest](/ko/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleaccountrequest.md)
