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

# PFAuthenticationLoginWithGoogleAccountRequest

> PFAuthenticationLoginWithGoogleAccountRequest データ モデル。Google サインインは、Google サインインを使用して Google OAuth 2.0 資格情報を取得することで行われます。

PFAuthenticationLoginWithGoogleAccountRequest データ モデル。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 Web アプリケーション クライアント ID を作成し、そのクライアント ID とシークレットをタイトルの PlayFab Game Manager Google アドオンで構成する必要があります。この方法では、ユーザーに追加の 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)) を参照してください。

## 構文

```cpp theme={null}
typedef struct PFAuthenticationLoginWithGoogleAccountRequest {  
    bool createAccount;  
    PFStringDictionaryEntry const* customTags;  
    uint32_t customTagsCount;  
    PFGetPlayerCombinedInfoRequestParams const* infoRequestParameters;  
    const char* playerSecret;  
    const char* serverAuthCode;  
    bool const* setEmail;  
} PFAuthenticationLoginWithGoogleAccountRequest;  
```

### メンバー

**`createAccount`**   bool

この ID に現在リンクされている PlayFab アカウントがない場合、自動的に PlayFab アカウントを作成します。

**`customTags`**   PFStringDictionaryEntry const\*<br />*may be nullptr*

(オプション) リクエストに関連付けるオプションのカスタム タグ (ビルド番号、外部トレース識別子など)。

**`customTagsCount`**   uint32\_t

customTags の数

**`infoRequestParameters`**   PFGetPlayerCombinedInfoRequestParams const\*<br />*may be nullptr*

(オプション) ユーザーに対して返す情報のフラグ。

**`playerSecret`**   const char\*<br />*is null-terminated*

(オプション) API リクエスト署名の検証に使用されるプレイヤー シークレット (Enterprise 専用)。

**`serverAuthCode`**   const char\*<br />*is null-terminated*

クライアントで getServerAuthCode() ([https://developers.google.com/identity/sign-in/android/offline-access](https://developers.google.com/identity/sign-in/android/offline-access)) Google クライアント API を呼び出して取得した OAuth 2.0 サーバー認証コード。

**`setEmail`**   bool const\*<br />*may be nullptr*

(オプション) Google アカウントを作成する際に MPA メール アドレスの設定をオプトアウトするオプションのブール値。既定は true です。

## 要件

**ヘッダー:** PFAuthenticationTypes.h

## 関連項目

[PFAuthenticationTypes のメンバー](/services/playfab/api-references/c/pfauthenticationtypes/pfauthenticationtypes_members)


## Related topics

- [PFAuthenticationLoginWithGoogleAccountAsync](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountasync.md)
- [PFAuthenticationReLoginWithGoogleAccountAsync](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithgoogleaccountasync.md)
- [Services C API overview - PFAuthenticationTypes.h](/ja-jp/services/playfab/api-references/c/pfauthenticationtypes/pfauthenticationtypes_members.md)
- [PFAuthenticationLoginWithGoogleAccountGetResult](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountgetresult.md)
- [PFAuthenticationLoginWithGoogleAccountGetResultSize](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleaccountgetresultsize.md)
