PageSourceSearch

https://docs.accelbyte.io/assets/js/4faf2643.8bda7544.js

js accelbyte.io collected 2026-10-02 04:32:46 UTC 58,630 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_ab_docs_main_app=self.webpackChunk_ab_docs_main_app||[]).push([["14060"],{625422:function(e,n,i){i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>d});var o=i(444819),l=i(552322),t=i(822840);let s={id:"google-identity",title:"Set up Google as an identity provider",description:"Set up Google as an identity provider for AGS",ab_notes:"",ab_teams:"ab_team_access"},r=void 0,a={},d=[{value:"Overview",id:"overview",level:2},{value:"Goals",id:"goals",level:2},{value:"Prerequisites",id:"prerequisites",level:2},{value:"For web login integration",id:"for-web-login-integration",level:3},{value:"For in-game Android login integration",id:"for-in-game-android-login-integration",level:3},{value:"Set up Google Cloud",id:"set-up-google-cloud",level:2},{value:"Create a Google Cloud Identity",id:"create-a-google-cloud-identity",level:3},{value:"Create a Google Console project",id:"create-a-google-console-project",level:3},{value:"Set up OAuth consent",id:"set-up-oauth-consent",level:3},{value:"Create OAuth credentials",id:"create-oauth-credentials",level:3},{value:"Set up the Google login provider in AGS",id:"set-up-the-google-login-provider-in-ags",level:2},{value:"For web login",id:"for-web-login",level:3},{value:"Edit the Google web login provider",id:"edit-the-google-web-login-provider",level:4},{value:"Test Google web login",id:"test-google-web-login",level:4},{value:"Activate Google login for a specific domain and role",id:"activate-google-login-for-a-specific-domain-and-role",level:4},{value:"Use a Google Organization Account for the Admin Portal",id:"use-a-google-organization-account-for-the-admin-portal",level:4},{value:"For in-game login",id:"for-in-game-login",level:3},{value:"Edit the Google in-game login provider",id:"edit-the-google-in-game-login-provider",level:4},{value:"Create an IAM client for Google",id:"create-an-iam-client-for-google",level:2},{value:"In-game login instructions",id:"in-game-login-instructions",level:2},{value:"In-game login integration (Unreal)",id:"in-game-login-integration-unreal",level:2},{value:"Preparation and configuration (Unreal)",id:"preparation-and-configuration-unreal",level:3},{value:"Preparing source code (Unreal)",id:"preparing-source-code-unreal",level:4},{value:"Creating a project (Unreal)",id:"creating-a-project-unreal",level:4},{value:"Enable <code>OnlineSubsystemGoogle</code> plugins and service configurations (Unreal)",id:"enable-onlinesubsystemgoogle-plugins-and-service-configurations-unreal",level:5},{value:"Project settings (Unreal)",id:"project-settings-unreal",level:5},{value:"Generating keystore (Unreal)",id:"generating-keystore-unreal",level:5},{value:"Sample code implementation (Unreal)",id:"sample-code-implementation-unreal",level:3},{value:"Sample code testing (Unreal)",id:"sample-code-testing-unreal",level:3},{value:"Upload the project to Google Play Console (Unreal)",id:"upload-the-project-to-google-play-console-unreal",level:3},{value:"In-game login integration (Unity)",id:"in-game-login-integration-unity",level:2},{value:"Upload project to Google Play Console (Unity)",id:"upload-project-to-google-play-console-unity",level:3}];function c(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",h5:"h5",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components},{TabItem:o,Tabs:s}=n;return o||g("TabItem",!0),s||g("Tabs",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,l.jsxs)(n.p,{children:["This guide helps developers connect Google accounts to AccelByte Gaming Services (AGS). Depending on your game, you may need to set up additional features within Google services that we haven't listed here. For more information about setting up Google services, we recommend contacting your Google representative and reviewing the ",(0,l.jsx)(n.a,{href:"https://cloud.google.com/docs",children:"Google Cloud documentation"})," directly."]}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["This guide covers standard Google sign-in. If you use the Google Play Games Services SDK for your Android game, see ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/foundations/identity-access/authentication/google-play-identity",children:"Google Play Games as an identity provider"})," instead."]})}),"\n",(0,l.jsx)(n.admonition,{title:"important",type:"important",children:(0,l.jsx)(n.p,{children:"This guide is intended for public use and contains limited information due to confidentiality. We recommend you refer to the full confidential guide first. To request a copy of the confidential guide, contact your AccelByte Technical Producer."})}),"\n",(0,l.jsx)(n.h2,{id:"goals",children:"Goals"}),"\n",(0,l.jsx)(n.p,{children:"To enable the Google authentication method for your game with the AGS SDK, and 
1your publisher website (with the AGS Player Portal)."}),"\n",(0,l.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,l.jsx)(n.h3,{id:"for-web-login-integration",children:"For web login integration"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"A Google Cloud Console account."}),"\n",(0,l.jsx)(n.li,{children:"An AGS Admin Portal Account to set up authentication and manage permissions."}),"\n",(0,l.jsx)(n.li,{children:"A publisher namespace for your Player Portal and launcher."}),"\n",(0,l.jsx)(n.li,{children:"A Player Portal."}),"\n",(0,l.jsxs)(n.li,{children:["To follow the AGS CLI steps, install the ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/developer-tools/ags-cli/",children:"AGS CLI"})," and sign in with an account that has access to these features. See ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/developer-tools/ags-cli/install-and-sign-in",children:"Install and sign in"}),". The examples use a Bash shell."]}),"\n"]}),"\n",(0,l.jsx)(n.admonition,{type:"sharedCloudDanger",children:(0,l.jsx)(n.p,{children:"Web login integration is currently unavailable in AGS Public Cloud and is only supported in AGS Private Cloud."})}),"\n",(0,l.jsx)(n.h3,{id:"for-in-game-android-login-integration",children:"For in-game Android login integration"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"A Google Cloud Console account."}),"\n",(0,l.jsx)(n.li,{children:"A Google Play Console account."}),"\n",(0,l.jsxs)(n.li,{children:["If you use Unreal Engine, you need:","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html",children:"JDK 1.8.X"})," source."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"https://developer.android.com/studio/archive",children:"Android Studio 4.0"}),". Follow the ",(0,l.jsx)(n.a,{href:"https://docs.unrealengine.com/4.26/en-US/SharingAndReleasing/Mobile/Android/Setup/AndroidStudio/",children:"Setting Up Android SDK and NDK for Unreal"})," guide."]}),"\n",(0,l.jsxs)(n.li,{children:["The ",(0,l.jsx)(n.a,{href:"https://github.com/EpicGames/UnrealEngine/releases/tag/4.27.2-release",children:"Unreal Engine 4.27 source code"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["If you use Unity Engine, you need to:","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["Follow the ",(0,l.jsx)(n.a,{href:"https://docs.unity3d.com/Manual/android-sdksetup.html",children:"Unity Android Environment Setup"})]}),"\n",(0,l.jsxs)(n.li,{children:["Have the latest version of the AGS ",(0,l.jsx)(n.a,{href:"https://github.com/AccelByte/accelbyte-unity-sdk",children:"Unity SDK"})," and ",(0,l.jsx)(n.a,{href:"https://github.com/AccelByte/accelbyte-unity-sdk-google",children:"Unity SDK Google"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"A Unity or Unreal game project with the latest version of the AGS SDK imported."}),"\n",(0,l.jsx)(n.li,{children:"An AGS Admin Portal Account to set up authentication and manage permissions."}),"\n",(0,l.jsx)(n.li,{children:"An AGS game namespace."}),"\n",(0,l.jsx)(n.li,{children:"Familiarity with AGS Identity and Access Management (IAM) Clients."}),"\n",(0,l.jsxs)(n.li,{children:["To follow the AGS CLI steps, install the ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/developer-tools/ags-cli/",children:"AGS CLI"})," and sign in with an account that has access to these features. See ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/developer-tools/ags-cli/install-and-sign-in",children:"Install and sign in"}),". The examples use a Bash shell."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"set-up-google-cloud",children:"Set up Google Cloud"}),"\n",(0,l.jsx)(n.h3,{id:"create-a-google-cloud-identity",children:"Create a Google Cloud Identity"}),"\n",(0,l.jsxs)(n.p,{children:["Create a Google Cloud Identity organization. Follow the ",(0,l.jsx)(n.a,{href:"https://cloud.google.com/identity/docs/set-up-cloud-identity-admin",children:"Set up Cloud Identity as a Google Cloud admin guide"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"create-a-google-console-project",children:"Create a Google Console project"}),"\n",(0,l.jsxs)(n.p,{children:["Create a new project under your Google Console. Follow the ",(0,l.jsx)(n.a,{href:"https://developers.google.com/workspace/guides/create-project",children:"Create a Google Cloud project Guide"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"set-up-oauth-consent",children:"Set up OAuth consent"}),"\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"OAuth consent screen"}),", add ",(0,l.jsx)(n.code,{children:"openid"})," scope to your app. For more information about user consent, refer to the ",(0,l.jsx)(n.a,{href:"https://developers.google.com/workspace/guides/configure-oauth-consent",children:"Configure the OAuth consent screen page"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"create-oauth-credentials",children:"Create OAuth credentials"}),"\n",(0,l.jsx)(n.p,{children:"Create OAuth credentials with the Web Application type and add these URLs to your OAuth Authorized redirect URIs:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"https://{BaseURL}"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"https://{BaseURL}/iam/v3/platforms/google/authenticate"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"https://{BaseURL}/player/account/linked-accounts"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"https://{BaseURL}/account/linked-accounts"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"https://{BaseURL}/account/linked-accounts?platformId=google"})}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"https://{BaseURL}/iam/v3/public/namespaces/{namespace}/users/me/platforms/google/web/link/establish"})," ",(0,l.jsx)(n.em,{children:"(used for account linking)"})]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"https://{BaseURL}/iam/v3/public/namespaces/{namespace}/users/me/platforms/google/web/reauth/establish"})," ",(0,l.jsx)(n.em,{children:"(used for GDPR re-authentication processes)"})]}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"http://127.0.0.1"})}),"\n"]}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"BaseURL"})," is your domain address. For example, ",(0,l.jsx)(n.code,{children:"https://development.accelbyte.io"}),"."]})}),"\n",(0,l.jsxs)(n.p,{children:["For more details, follow Google's ",(0,l.jsx)(n.a,{href:"https://support.google.com/cloud/answer/6158849",children:"Setting up OAuth 2.0"})," guide."]}),"\n",(0,l.jsx)(n.h2,{id:"set-up-the-google-login-provider-in-ags",children:"Set up the Google login provider in AGS"}),"\n",(0,l.jsx)(n.h3,{id:"for-web-login",children:"For web login"}),"\n",(0,l.jsx)(n.admonition,{title:"AGS Private Cloud only",type:"caution",children:(0,l.jsx)(n.p,{children:"Google web login is only available in Private Cloud publisher namespaces."})}),"\n",(0,l.jsxs)(s,{groupId:"interface",children:[(0,l.jsx)(o,{value:"admin-portal",label:"Admin Portal",default:!0,children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"In the AGS Admin Portal, go to your publisher namespace."}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the sidebar menu, go to ",(0,l.jsx)(n.strong,{children:"Foundations"})," > ",(0,l.jsx)(n.strong,{children:"3rd Party Integrations"})," > ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"}),"."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Auth &amp; Account Linking page with the Add New button",src:i(786378).Z+"",width:"1900",height:"827"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"})," page, click ",(0,l.jsx)(n.strong,{children:"+ Add New"}),"."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Select login provider"})," page, find ",(0,l.jsx)(n.strong,{children:"Google"})," under the ",(0,l.jsx)(n.strong,{children:"Social"})," tab and click on it."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Select login provider page with the Google card highlighted",src:i(168397).Z+"",width:"1526",height:"825"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.strong,{children:"Set up Google login provider"})," form appears."]}),"\n",(0,l.jsxs)(n.p,{children:["Before you start, register the redirect URIs shown in the ",(0,l.jsx)(n.strong,{children:"Before you start"})," section in your Google Cloud Console."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Set up Google login provider form showing the redirect URIs to register",src:i(8767).Z+"",width:"561",height:"899"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Fill in the following fields:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Platform ID"}),": ",(0,l.jsx)(n.code,{children:"google"}),". Set automatically. Cannot be changed."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Client ID"}),": Your Google OAuth Client ID from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Client secret"}),": Your Google OAuth Client Secret from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Redirect URI"}),": Your Google OAuth Authorized Redirect URI: ",(0,l.jsx)(n.code,{children:"https://<BaseURL>/iam/v3/platforms/google/authenticate"}),"."]}),"\n"]}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["Replace ",(0,l.jsx)(n.code,{children:"<BaseURL>"})," with your domain address. For example: ",(0,l.jsx)(n.code,{children:"https://development.accelbyte.io"})]})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Click ",(0,l.jsx)(n.strong,{children:"Add & Activate"})," to create and activate the provider in one step. Alternatively, click ",(0,l.jsx)(n.strong,{children:"Add"})," to create without activating."]}),"\n"]}),"\n"]})}),(0,l.jsx)(o,{value:"ags-cli",label:"AGS CLI",children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Create a JSON file with the provider's settings. Any file name works. This example uses ",(0,l.jsx)(n.code,{children:"google.json"}),":"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n  "ClientId": "<YourGoogleClientId>",\n  "Secret": "<YourGoogleClientSecret>",\n  "RedirectUri": "<BaseURL>/iam/v3/platforms/google/authenticate",\n  "IsActive": true\n}\n'})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"ClientId"})," and ",(0,l.jsx)(n.code,{children:"Secret"}),": your Google OAuth Client ID and Client Secret from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"RedirectUri"}),": your Google OAuth Authorized Redirect URI. Replace ",(0,l.jsx)(n.code,{children:"<BaseURL>"})," with your domain address, such as ",(0,l.jsx)(n.code,{children:"https://development.accelbyte.io"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"IsActive"}),": ",(0,l.jsx)(n.code,{children:"true"})," adds and activates the provider, like ",(0,l.jsx)(n.strong,{children:"Add & Activate"}),". ",(0,l.jsx)(n.code,{children:"false"})," adds it without activating it, like ",(0,l.jsx)(n.strong,{children:"Add"}),"."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Add the provider. Replace ",(0,l.jsx)(n.code,{children:"<YourPublisherNamespace>"})," with your publisher namespace. After ",(0,l.jsx)(n.code,{children:"@"}),", pass the path to your JSON file:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials create --namespace <YourPublisherNamespace> --platform-id google --json @google.json\n"})}),"\n",(0,l.jsx)(n.p,{children:"The file contains your client secret, so delete it after the command runs."}),"\n"]}),"\n"]})})]}),"\n",(0,l.jsx)(n.h4,{id:"edit-the-google-web-login-provider",children:"Edit the Google web login provider"}),"\n",(0,l.jsxs)(s,{groupId:"interface",children:[(0,l.jsx)(o,{value:"admin-portal",label:"Admin Portal",default:!0,children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"})," page, click the Google provider."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["The Google provider's detail page appears, showing its ",(0,l.jsx)(n.strong,{children:"Basic Information"})," and ",(0,l.jsx)(n.strong,{children:"Domain"})," sections. Click the edit icon next to a field to update it."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Google provider detail page showing the Basic Information and Domain sections",src:i(169053).Z+"",width:"1596",height:"839"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Use the ",(0,l.jsx)(n.strong,{children:"Status"})," toggle at the top of the page to activate or deactivate the provider."]}),"\n"]}),"\n"]})}),(0,l.jsx)(o,{value:"ags-cli",label:"AGS CLI",children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Check the provider's current settings:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials get --namespace <YourPublisherNamespace> --platform-id google\n"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Send only the fields you want to change. Fields you leave out keep their current values. For example, to deactivate the provider:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials update --namespace <YourPublisherNamespace> --platform-id google --json '{\"IsActive\": false}'\n"})}),"\n",(0,l.jsxs)(n.p,{children:["To activate it, send ",(0,l.jsx)(n.code,{children:'{"IsActive": true}'}),". To change the client secret, put ",(0,l.jsx)(n.code,{children:'{"Secret": "<NewGoogleClientSecret>"}'})," in a JSON file instead, pass it with ",(0,l.jsx)(n.code,{children:"--json @<FileName>"}),", and delete the file after the command runs."]}),"\n"]}),"\n"]})})]}),"\n",(0,l.jsx)(n.h4,{id:"test-google-web-login",children:"Test Google web login"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Go to your AGS Player Portal (for example, ",(0,l.jsx)(n.code,{children:"https://development.accelbyte.io"}),") and click Login."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Under ",(0,l.jsx)(n.strong,{children:"Sign up or log in with"}),", find and click the Google icon. Click ",(0,l.jsx)(n.strong,{children:"More login options"})," if you don't see it."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Use your Google credentials to log in."}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"activate-google-login-for-a-specific-domain-and-role",children:"Activate Google login for a specific domain and role"}),"\n",(0,l.jsx)(n.p,{children:"Google login integration allows you to handle logins using a specific Google Domain and directly assign it a specific role. For example, if you want to enable your organization member to login to the AGS Admin Port using their Google Organization account, you can register your Google Organization domain."}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["You are only able to do this for ",(0,l.jsx)(n.strong,{children:"Publisher Namespaces"}),"."]})}),"\n",(0,l.jsxs)(s,{groupId:"interface",children:[(0,l.jsx)(o,{value:"admin-portal",label:"Admin Portal",default:!0,children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Under the Google login provider configuration, click ",(0,l.jsx)(n.strong,{children:"+ Register Domain"}),"."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Register Domain form with Domain Name, Clients, and Default Role 
1fields",src:i(972155).Z+"",width:"651",height:"795"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Fill in the following fields:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Domain Name"}),": Your Google Organization account domain. Example format: ",(0,l.jsx)(n.code,{children:"yourdomain.io"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Clients"}),": The IAM Client Name of your Admin Portal. For the details of IAM Client, refer to the ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/foundations/identity-access/authorization/manage-access-control-for-applications",children:"Manage access control for applications guide"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Default Role"}),": The role assigned to your organization member once you log in to the Admin Portal using your Google Organization account. Example value: ",(0,l.jsx)(n.code,{children:"Admin Portal"}),". For more details about roles, refer to the ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/foundations/identity-access/authorization/manage-access-control-for-user-accounts",children:"Manage access control for user accounts guide"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Default Namespace"}),": If the default role is not a global role, specify the target namespace this role applies to."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Click ",(0,l.jsx)(n.strong,{children:"Save"}),"."]}),"\n"]}),"\n"]})}),(0,l.jsx)(o,{value:"ags-cli",label:"AGS CLI",children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Find the client ID of your Admin Portal IAM client:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam clients list --namespace <YourPublisherNamespace> --page-all\n"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Find the ID of the role to assign to your organization members. A role that applies to all namespaces has ",(0,l.jsx)(n.code,{children:"isWildcard"})," set to ",(0,l.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam roles list --page-all --format json\n"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Create a JSON file with the domain settings. Any file name works. This example uses ",(0,l.jsx)(n.code,{children:"google-domain.json"}),":"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n  "domain": "<YourDomain>",\n  "affectedClientIDs": ["<AdminPortalClientId>"],\n  "roleId": "<DefaultRoleId>",\n  "assignedNamespaces": ["<DefaultNamespace>"]\n}\n'})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"domain"}),": your Google Organization account domain, such as ",(0,l.jsx)(n.code,{children:"yourdomain.io"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"affectedClientIDs"}),": the client ID from step 1."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"roleId"}),": the role ID from step 2."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"assignedNamespaces"}),": the namespace the role applies to. If the role applies to all namespaces, use ",(0,l.jsx)(n.code,{children:'["*"]'}),"."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Register the domain. Replace ",(0,l.jsx)(n.code,{children:"<YourPublisherNamespace>"})," with your publisher namespace:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials set-domain --namespace <YourPublisherNamespace> --platform-id google --json @google-domain.json\n"})}),"\n"]}),"\n"]})})]}),"\n",(0,l.jsx)(n.h4,{id:"use-a-google-organization-account-for-the-admin-portal",children:"Use a Google Organization Account for the Admin Portal"}),"\n",(0,l.jsx)(n.p,{children:"After the steps above, use these steps to log in to the Admin Portal using your Google Organization account."}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Go to your Admin Portal and click the ",(0,l.jsx)(n.strong,{children:"Google"})," icon to log in Google."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"click Google icon to log in",src:i(701642).Z+"",width:"1919",height:"1079"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Login with your Google Organization account credentials. This will log you in as an admin."}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"admin portal main page",src:i(652211).Z+"",width:"1919",height:"1079"})}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"for-in-game-login",children:"For in-game login"}),"\n",(0,l.jsxs)(s,{groupId:"interface",children:[(0,l.jsx)(o,{value:"admin-portal",label:"Admin Portal",default:!0,children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"In the AGS Admin Portal, go to your game namespace."}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the sidebar menu, go to ",(0,l.jsx)(n.strong,{children:"Foundations"})," > ",(0,l.jsx)(n.strong,{children:"3rd Party Integrations"})," > ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"}),"."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Auth &amp; Account Linking page under a game namespace",src:i(70550).Z+"",width:"1897",height:"831"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"})," page, click ",(0,l.jsx)(n.strong,{children:"+ Add New"}),"."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Select login provider"})," page, find ",(0,l.jsx)(n.strong,{children:"Google"})," under the ",(0,l.jsx)(n.strong,{children:"Social"})," tab and click on it."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.strong,{children:"Set up Google login provider"})," form appears."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Set up Google login provider form for in-game login 
1with the localhost redirect URI",src:i(520756).Z+"",width:"673",height:"829"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Fill in the following fields:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Platform ID"}),": ",(0,l.jsx)(n.code,{children:"google"}),". Set automatically. Cannot be changed."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Client ID"}),": Your Google OAuth Client ID from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Client secret"}),": Your Google OAuth Client Secret from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Redirect URI"}),": Your localhost URI: ",(0,l.jsx)(n.code,{children:"http://127.0.0.1"})]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Click ",(0,l.jsx)(n.strong,{children:"Add & Activate"})," to create and activate the provider in one step. Alternatively, click ",(0,l.jsx)(n.strong,{children:"Add"})," to create without activating."]}),"\n"]}),"\n"]})}),(0,l.jsx)(o,{value:"ags-cli",label:"AGS CLI",children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Create a JSON file with the provider's settings. Any file name works. This example uses ",(0,l.jsx)(n.code,{children:"google.json"}),":"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n  "ClientId": "<YourGoogleClientId>",\n  "Secret": "<YourGoogleClientSecret>",\n  "RedirectUri": "http://127.0.0.1",\n  "IsActive": true\n}\n'})}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"ClientId"})," and ",(0,l.jsx)(n.code,{children:"Secret"}),": your Google OAuth Client ID and Client Secret from the Google Cloud Console."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"IsActive"}),": ",(0,l.jsx)(n.code,{children:"true"})," adds and activates the provider, like ",(0,l.jsx)(n.strong,{children:"Add & Activate"}),". ",(0,l.jsx)(n.code,{children:"false"})," adds it without activating it, like ",(0,l.jsx)(n.strong,{children:"Add"}),"."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Add the provider. Replace ",(0,l.jsx)(n.code,{children:"<YourGameNamespace>"})," with your game namespace. After ",(0,l.jsx)(n.code,{children:"@"}),", pass the path to your JSON file:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials create --namespace <YourGameNamespace> --platform-id google --json @google.json\n"})}),"\n",(0,l.jsx)(n.p,{children:"The file contains your client secret, so delete it after the command runs."}),"\n"]}),"\n"]})})]}),"\n",(0,l.jsx)(n.h4,{id:"edit-the-google-in-game-login-provider",children:"Edit the Google in-game login provider"}),"\n",(0,l.jsxs)(s,{groupId:"interface",children:[(0,l.jsx)(o,{value:"admin-portal",label:"Admin Portal",default:!0,children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["On the ",(0,l.jsx)(n.strong,{children:"Auth & Account Linking"})," page, click the Google provider."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.strong,{children:"Google login provider"})," dialog appears. Update the fields as needed."]}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.img,{alt:"Google login provider edit dialog with the Active status toggle",src:i(684386).Z+"",width:"750",height:"759"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Use the ",(0,l.jsx)(n.strong,{children:"Status"})," toggle at the top to activate or deactivate the provider."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Click ",(0,l.jsx)(n.strong,{children:"Save"}),"."]}),"\n"]}),"\n"]})}),(0,l.jsx)(o,{value:"ags-cli",label:"AGS CLI",children:(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Check the provider's current settings:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials get --namespace <YourGameNamespace> --platform-id google\n"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Send only the fields you want to change. Fields you leave out keep their current values. For example, to deactivate the provider:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"ags iam platform-credentials update --namespace <YourGameNamespace> --platform-id google --json '{\"IsActive\": false}'\n"})}),"\n",(0,l.jsxs)(n.p,{children:["To activate it, send ",(0,l.jsx)(n.code,{children:'{"IsActive": true}'}),". To change the client secret, put ",(0,l.jsx)(n.code,{children:'{"Secret": "<NewGoogleClientSecret>"}'})," in a JSON file instead, pass it with ",(0,l.jsx)(n.code,{children:"--json @<FileName>"}),", and delete the file after the command runs."]}),"\n"]}),"\n"]})})]}),"\n",(0,l.jsx)(n.h2,{id:"create-an-iam-client-for-google",children:"Create an IAM client for Google"}),"\n",(0,l.jsxs)(n.p,{children:["An IAM client is a representation of the game client that you want to release on your target platform. Learn more about IAM Clients in ",(0,l.jsx)(n.a,{href:"/gaming-services/modules/foundations/identity-access/authorization/manage-access-control-for-applications",children:"Manage access control for applications"}),"."]}),"\n",(0,l.jsx)(n.h2,{id:"in-game-login-instructions",children:"In-game login instructions"}),"\n",(0,l.jsx)(n.p,{children:"By following this documentation, you can integrate your game sign-in process using the AGS SDK so your players can log in to games using their Google Accounts. For a player to log in to your game or platform with Google credentials, the game needs to pass the Auth token from the Google platform that has the credentials the player is using to the publisher platform."}),"\n",(0,l.jsx)(n.p,{children:"The setup for each game engine is different. Choose your game engine from the available tabs."}),"\n",(0,l.jsxs)(s,{groupId:"platforms",children:[(0,l.jsxs)(o,{value:"unreal",label:"Unreal Engine Instructions",default:!0,children:[(0,l.jsx)(n.h2,{id:"in-game-login-integration-unreal",children:"In-game login integration (Unreal)"}),(0,l.jsx)(n.h3,{id:"preparation-and-configuration-unreal",children:"Preparation and configuration (Unreal)"}),(0,l.jsx)(n.h4,{id:"preparing-source-code-unreal",children:"Preparing source code (Unreal)"}),(0,l.jsx)(n.p,{children:"You will need the dedicated Unreal Engine source code to be able to use the Google online subsystem."}),(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Download Unreal Engine version 4.27.2 from the Epic Games GitHub: ",(0,l.jsx)(n.a,{href:"https://github.com/EpicGames/UnrealEngine/releases/tag/4.27.2-release",children:"Release Unreal Engine 4.27.2 \xb7 EpicGames/UnrealEngine (github.com)"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["Some of the source code needs to be modified.","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Enable the Server Auth Code."}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Go the directory of your Unreal Engine installation and open the ",(0,l.jsx)(n.code,{children:"GoogleLogin.java"})," file that is located in the folder ",(0,l.jsx)(n.code,{children:"Engine\\Plugins\\Online\\OnlineSubsystemGoogle\\Source\\ThirdParty\\Android\\Java\\"}),". Make the following changes to this file:"]}),"\n"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Go to ",(0,l.jsx)(n.code,{children:"public boolean init(String inClientId, String inServerClientId)"}),", then scroll down to uncomment the ",(0,l.jsx)(n.code,{children:".requestServerAuthCode(serverClientId)"})," part."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:"// Configure sign-in to request the user's ID, email address, and basic\n// profile. ID and basic profile are included in DEFAULT_SIGN_IN.\nGoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n    .requestIdToken(serverClientId)\n    .requestProfile()\n    .requestServerAuthCode(serverClientId)\n    .requestEmail()\n    .build();\n\n// Build a GoogleSignInClient with the options specified by gso.\nmGoogleSignInClient = GoogleSignIn.getClient(activity, gso);\n"})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Go to ",(0,l.jsx)(n.code,{children:"private String getAuthTokenJsonStr(GoogleSignInAccount acct)"}),", then scroll down to change ",(0,l.jsx)(n.code,{children:"access_token"})," value from ",(0,l.jsx)(n.code,{children:"androidInternal"})," to ",(0,l.jsx)(n.code,{children:"acct.getServerAuthCode()"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'private String getAuthTokenJsonStr(GoogleSignInAccount acct)\n{\n  if (acct != null)\n  {\n    return "{\\"access_token\\"
1:\\""+ acct.getServerAuthCode() +  "\\"," + //androidInternal\\"," +\n        "\\"refresh_token\\":\\"androidInternal\\"," +\n        "\\"id_token\\":\\""+ acct.getIdToken() + "\\"}";\n  }\n  return "";\n}\n'})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Disable restful implementation."}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Go the directory of your Unreal Engine installation and open the ",(0,l.jsx)(n.code,{children:"OnlineSubsystemGoogle.Build.cs"})," file that is located in the folder ",(0,l.jsx)(n.code,{children:"Engine\\Plugins\\Online\\OnlineSubsystemGoogle\\Source\\"}),". Make the following changes:"]}),"\n"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["Go to the ",(0,l.jsx)(n.code,{children:"constructor"})," and add ",(0,l.jsx)(n.code,{children:"bool bUsesRestfulImpl = false;"})]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'public class OnlineSubsystemGoogle : ModuleRules\n{\n  public OnlineSubsystemGoogle(ReadOnlyTargetRules Target) : base(Target)\n  {\n    bool bUsesRestfulImpl = false;\n    PrivateDefinitions.Add("ONLINESUBSYSTEMGOOGLE_PACKAGE=1");\n    PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;\n\n    PrivateIncludePaths.Add("Private");\n'})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"After everything is changed, compile the C++ code again to make sure all the changes are compiled and included when packaging the Android build."}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["The same directory, open the file ",(0,l.jsx)(n.code,{children:"OnlineSubsystemGoogle.plugin"}),"."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["To that file, under ",(0,l.jsx)(n.code,{children:"Modules"}),", add the value ",(0,l.jsx)(n.code,{children:"Android"})," to ",(0,l.jsx)(n.code,{children:"WhitelistPlatforms"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n  "FileVersion" : 3,\n  \n  "FriendlyName" : "Online Subsystem Google",\n  "Version" : 1,\n  "VersionName" : "1.0",\n  "Description" : "Access to Google platform",\n  "Category" : "Online Platform",\n  "CreatedBy" : "Epic Games, Inc.",\n  "CreatedByURL" : "http://epicgames.com",\n  "EnabledByDefault" : false,\n\n  "Modules": [\n        {\n            "Name": "OnlineSubsystemGoogle",\n            "Type": "Runtime",\n            "LoadingPhase" : "Default",\n            "WhitelistPlatforms" :\n            [\n              "Win64","Win32", "Android"\n            ]\n        }\n    ],\n  "Plugins": [\n    {\n      "Name": "OnlineSubsystem",\n      "Enabled": true\n    }\n  ]\n}\n'})}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),(0,l.jsx)(n.h4,{id:"creating-a-project-unreal",children:"Creating a project (Unreal)"}),(0,l.jsx)(n.p,{children:"After creating a new Unreal Engine project, you will need to set and config several items."}),(0,l.jsxs)(n.h5,{id:"enable-onlinesubsystemgoogle-plugins-and-service-configurations-unreal",children:["Enable ",(0,l.jsx)(n.code,{children:"OnlineSubsystemGoogle"})," plugins and service configurations (Unreal)"]}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Enable Plugins on the project file."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n  "FileVersion": 3,\n  "EngineAssociation": "{4D293DA0-4F8F-387E-BF30-77B1100DBEBF}",\n  "Category": "",\n  "Description": "",\n  "Modules": [\n    {\n      "Name": "TestGoogleLogin",\n      "Type": "Runtime",\n      "LoadingPhase": "Default",\n      "AdditionalDependencies": [\n        "Engine"\n      ]\n    }\n  ],\n  "Plugins": [\n    {\n      "Name": "AccelByteUe4Sdk",\n      "Enabled": true\n    }, \n    {\n      "Name": "OnlineSubsystemGoogle",\n      "Enabled": true\n    }\n  ]\n}\n'})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:["In the ",(0,l.jsx)(n.code,{children:"<project>/Config/Android"})," directory, open the ",(0,l.jsx)(n.code,{children:"AndroidEngine.ini"})," file and make the following changes:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-yaml",children:'[OnlineSubsystem]\n; For Android, our native service will be Google Play\nDefaultPlatformService=GooglePlay\nNativePlatformService=Google\n\n[OnlineSubsystemGoogle]\nbEnabled=True\nClientId=662680510101-gojaaltsfsg4ei75afnfii3e43ebocgp.apps.googleusercontent.com\nServerClientId=662680510101-gojaaltsfsg4ei75afnfii3e43ebocgp.apps.googleusercontent.com\nClientSecret=GOCSPX-zR_pvAu6EruK-s0yf2v3********\n\n[OnlineSubsystemGoogle.OnlineIdentityGoogle]\n+ScopeFields="email"\n+ScopeFields="profile"\n+ScopeFields="https://www.googleapis.com/auth/userinfo.email"\n+ScopeFields="https://www.googleapis.com/auth/userinfo.profile"\n\n[OnlineSubsystemGooglePlay]\nbEnabled=True\n\n[OnlineSubsystemGooglePlay.Store]\nbSupportsInAppPurchasing=True\nbUseStoreV2=False\n\n[/Script/AccelByteUe4Sdk.AccelByteSettings]\nClientId=a342f59f3489476ca02d704
1c75891a3b\nClientSecret=k@#h,G]R^C61#2d!************\nNamespace=sdktest\nPublisherNamespace=accelbyte\nBaseUrl="https://development.accelbyte.io"\n'})}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"OnlineSubsystemGoogle ClientId"})," is obtained from the game server credentials on your Google Play Console and the ",(0,l.jsxs)(n.strong,{children:["AccelByte ",(0,l.jsx)(n.code,{children:"ClientId"})]})," is obtained from IAM Client credentials."]})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:"Project plugin and module"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.code,{children:"[PROJECT].Build.cs"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'// Copyright Epic Games, Inc. All Rights Reserved.\n\nusing UnrealBuildTool;\n\npublic class TestGoogleLogin : ModuleRules\n{\n  public TestGoogleLogin(ReadOnlyTargetRules Target) : base(Target)\n  {\n    PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;\n  \n    PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore",\n            "OnlineSubsystem",\n            "OnlineSubsystemUtils",\n            "Sockets", "Networking", "InputCore", "AccelByteUe4Sdk", "Json", "JsonUtilities", "Http", "WebSockets"\n        });\n\n    PrivateDependencyModuleNames.AddRange(new string[] {  });\n\n    // Uncomment if you are using Slate UI\n    // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });\n    \n    // Uncomment if you are using online features\n    PrivateDependencyModuleNames.Add("OnlineSubsystem");\n\n    // To include OnlineSubsystemSteam, add it to the plugins section in your project file with the Enabled attribute set to true\n  }\n}\n'})}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"[PROJECT].Target.cs"})," file and ",(0,l.jsx)(n.code,{children:"[PROJECT]Editor.Target.cs"})," files"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'// Copyright Epic Games, Inc. All Rights Reserved.\n\nusing UnrealBuildTool;\nusing System.Collections.Generic;\n\npublic class TestGoogleLoginEditorTarget : TargetRules\n{\n  public TestGoogleLoginEditorTarget( TargetInfo Target) : base(Target)\n  {\n    Type = TargetType.Editor;\n    DefaultBuildSettings = BuildSettingsVersion.V2;\n    ExtraModuleNames.AddRange( new string[] { "TestGoogleLogin", "OnlineSubsystem", "AccelByteUe4Sdk" } );\n\n        ProjectDefinitions.Add("ONLINE_SUBSYSTEM_EOS_ENABLE_GOOGLE=1");\n    }\n}\n'})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'// Copyright Epic Games, Inc. All Rights Reserved.\n\nusing UnrealBuildTool;\nusing System.Collections.Generic;\n\npublic class TestGoogleLoginTarget : TargetRules\n{\n  public TestGoogleLoginTarget( TargetInfo Target) : base(Target)\n  {\n    Type = TargetType.Game;\n    DefaultBuildSettings = BuildSettingsVersion.V2;\n    ExtraModuleNames.AddRange( new string[] { "TestGoogleLogin", "OnlineSubsystem", "AccelByteUe4Sdk" } );\n\n        ProjectDefinitions.Add("ONLINE_SUBSYSTEM_EOS_ENABLE_GOOGLE=1");\n    }\n}\n'})}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),(0,l.jsx)(n.h5,{id:"project-settings-unreal",children:"Project settings (Unreal)"}),(0,l.jsx)(n.p,{children:"Set your Unreal project packaging, Android platform, and Credential/License."}),(0,l.jsx)(n.h5,{id:"generating-keystore-unreal",children:"Generating keystore (Unreal)"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["Follow the ",(0,l.jsx)(n.a,{href:"https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/DistributionSigning/",children:"Signing projects for release guide"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["Go to the directory ",(0,l.jsx)(n.code,{children:"C:\\Program Files\\Android\\Android Studio\\jre\\bin"})," and open ",(0,l.jsx)(n.code,{children:"keystore.exe"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["Run the command: ",(0,l.jsx)(n.code,{children:"keytool -genkey -v -keystore ExampleKey.keystore -**alias** MyKey -keyalg RSA -keysize 2048 -validity 10000"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:["Put generated ",(0,l.jsx)(n.code,{children:"*.keystore"})," file the location ",(0,l.jsx)(n.code,{children:"justice-unreal-sdk-project - Android\\Build\\Android"}),"."]}),"\n"]}),(0,l.jsx)(n.h3,{id:"sample-code-implementation-unreal",children:"Sample code implementation (Unreal)"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"You can create a class actor and put the Google native login and AGS's Access service on that level. Here is an example:"}),"\n"]}),(0,l.jsx)(n.p,{children:"SampleActor.h"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'// Fill out your copyright notice in the Description page of Project Settings.\n\n##pragma once\n\n##include "CoreMinimal.h"\n##include "GameFramework/Actor.h"\n\n##include "Kismet/GameplayStatics.h"\n##include "OnlineSubsystem.h"\n##include "Interfaces/OnlineIdentityInterface.h"\n##include "Interfaces/OnlinePurchaseInterface.h"\n\n##include "Core/AccelByteRegistry.h"\n##include "Api/AccelByteUserApi.h"\n\n##include "SampleActor.generated.h"\n\nDECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FActionInfo, FString, Message);\n\nUCLASS()\nclass TESTGOOGLELOGIN_API ASampleActor : public AActor\n{\n  GENERATED_BODY()\n  \npublic:\n  // Sets default values for this actor\'s properties\n  ASampleActor();\n\n  UPROPERTY(BlueprintAssignable)\n  FActionInfo OnActionInfoUpdated;\n\n  UFUNCTION(BlueprintCallable)\n  void ExecBroadcast();\n\nprotected:\n  // Called when the game starts or when spawned\n  virtual void BeginPlay() override;\n\n  FApiClientPtr ApiClient = nullptr;\n\npublic:\n  // Called every frame\n  virtual void Tick(float DeltaTime) override;\n\n};\n'})}),(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["To obtain ",(0,l.jsx)(n.strong,{children:"AccelByteO
1nlineSubsystemPtr"})," used in snippet, follow this ",(0,l.jsx)(n.a,{href:"/gaming-services/knowledge-base/sdk-tools/sdk-guides/accelbyte-singleton-in-sdk/manage-ags-ue-sdk-accelbyte-instance",children:"guide."})]})}),(0,l.jsx)(n.p,{children:"SampleActor.cpp"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-cpp",children:'// Fill out your copyright notice in the Description page of Project Settings.\n\n##include "SampleActor.h"\n\n// Sets default values\nASampleActor::ASampleActor()\n{\n  // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don\'t need it.\n  PrimaryActorTick.bCanEverTick = true;\n  ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient(TEXT("YOUR_KEY"));\n}\n\n// Called when the game starts or when spawned\nvoid ASampleActor::BeginPlay()\n{\n  Super::BeginPlay();\n  \n}\n  \nvoid ASampleActor::ExecBroadcast()\n{ \n  OnActionInfoUpdated.Broadcast(TEXT("Begin Sample Actor")); \n  \n  const IOnlineSubsystem* OnlineSubsystem = IOnlineSubsystem::GetByPlatform();\n  if (OnlineSubsystem == nullptr)\n  {\n    FString Message = TEXT("Cannot login with no online subsystem set!");\n    OnActionInfoUpdated.Broadcast(Message);\n    return;\n  }\n\n  const IOnlineIdentityPtr OnlineIdentity = OnlineSubsystem->GetIdentityInterface();\n  if (!OnlineIdentity.IsValid())\n  {\n    FString Message = TEXT("Could not retrieve identity interface from native subsystem.");\n    OnActionInfoUpdated.Broadcast(Message);\n    return;\n  }\n  APlayerController* MyPlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);; // = PlayerControllerWeakPtr.Get();\n\n  const ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(MyPlayerController->Player);\n  if (LocalPlayer == nullptr)\n  {\n    FString Message = TEXT("Can only login with native platform for local players");\n    OnActionInfoUpdated.Broadcast(Message);\n    return;\n  }\n  \n  const FVoidHandler OnLoginSuccessDelegate = FVoidHandler::CreateLambda([=]() {\n    OnActionInfoUpdated.Broadcast(TEXT("Login to AB Service Success"));\n  }); \n  const FErrorHandler OnLoginErrorDelegate = FErrorHandler::CreateLambda([=](int32 ErrorCode, const FString& ErrorMessage) {\n    FString Message = FString::Printf(TEXT("Error Login to AB Service : %s"), *ErrorMessage);\n    OnActionInfoUpdated.Broadcast(Message);\n  });\n\n  const FOnLoginCompleteDelegate NativeLoginComplete = FOnLoginCompleteDelegate::CreateLambda([=]\n  (int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& Error) {\n    FString Message = FString::Printf(TEXT("OnLoginComplete %s : %s"), bWasSuccessful ? TEXT("Success") : TEXT("Fail"), *Error);\n    OnActionInfoUpdated.Broadcast(Message);\n\n    if (bWasSuccessful)\n    {\n      const FString PlatformToken = OnlineIdentity->GetAuthToken(LocalPlayer->GetControllerId());\n      UE_LOG(LogTemp, Warning, TEXT("PlatformToken : %s"), *PlatformToken);\n      OnActionInfoUpdated.Broadcast(FString::Printf(TEXT("PlatformToken : %s"), *PlatformToken));\n\n      auto UserApi = ApiClient->GetUserApi().Pin();\n      UserApi->LoginWithOtherPlatform(EAccelBytePlatformType::Google, PlatformToken, OnLoginSuccessDelegate, OnLoginErrorDelegate);\n      UE_LOG(LogTemp, Warning, TEXT("Request LoginWithOtherPlatform"));\n      OnActionInfoUpdated.Broadcast(TEXT("Request LoginWithOtherPlatform"));\n\n    }\n  });\n  OnlineIdentity->AddOnLoginCompleteDelegate_Handle(LocalPlayer->GetControllerId(), NativeLoginComplete);\n  const bool bWaitForDelegate = OnlineIdentity->Login(LocalPlayer->GetControllerId(), FOnlineAccountCredentials());\n  if (!bWaitForDelegate)\n  {\n    FString Message = TEXT("The online subsystem couldn\'t login");\n    OnActionInfoUpdated.Broadcast(Message);\n  }\n\n  FString Message = TEXT("Sending login request to native subsystem!");\n  OnActionInfoUpdated.Broadcast(Message);\n}\n\n// Called every frame\nvoid ASampleActor::Tick(float DeltaTime)\n{\n  Super::Tick(DeltaTime);\n\n}\n'})}),(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"platform_token"})," for Google Authentication is the Auth Token."]})}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"Afterwards, implement and integrate it along with the widget blueprint."}),"\n"]}),(0,l.jsx)(n.h3,{id:"sample-code-testing-unreal",children:"Sample code testing (Unreal)"}),(0,l.jsx)(n.p,{children:"After all the settings, configuration, and some implementation is done, compile and deploy the app to your Android Device. Then, you can log in to AGS through the Google native login service."}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["Make sure your Android device is detected on your PC and run following command on your terminal: ",(0,l.jsx)(n.code,{children:"adb devices"})]}),"\n",(0,l.jsx)(n.li,{children:"Package the project to Android (ASTC)."}),"\n",(0,l.jsx)(n.li,{children:"Install the app to your Android device and run it."}),"\n"]}),(0,l.jsx)(n.h3,{id:"upload-the-project-to-google-play-console-unreal",children:"Upload the project to Google Play Console (Unreal)"}),(0,l.jsx)(n.p,{children:"Build your Unreal project to have AAB format with a designated keystore. It can be a blank project if you still have yet to configure your Google Login to an Unreal project. After publishing your game, you are now ready to test."}),(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["If you have not yet published your game, you will need to add tester accounts to be able to test your game with Google Accounts. Please follow ",(0,l.jsx)(n.a,{href:"https://support.google.com/googleplay/android-developer/answer/9845334?hl=en#zippy=%2Cinternal-test-manage-up-to-testers",children:"Set up an open, closed, or internal test guide"}),"."]})})]}),(0,l.jsxs)(o,{value:"unity",label:"Unity Engine Instructions",children:[(0,l.jsx)(n.h2,{id:"in-game-login-integration-unity",children:"In-game login integration (Unity)"}),(0,l.jsxs)(n.p,{children:["The AccelByte Unity SDK Google extension enables you to integrate Google Account's features with AGS. You can find and download this extension on ",(0,l.jsx)(n.a,{href:"https://github.com/AccelByte/accelbyte-unity-sdk-google",children:"GitHub"}),". To install the extension and implement Google login into your game, follow the extension's ",(0,l.jsx)(n.a,{href:"https://github.com/AccelByte/accelbyte-unity-sdk-google?tab=readme-ov-file#how-to-install",children:"installation guide"})," on GitHub."]}),(0,l.jsx)(n.h3,{id:"upload-project-to-google-play-console-unity",children:"Upload project to Google Play Console (Unity)"}),(0,l.jsxs)(n.p,{children:["Build the Unity project in AAB format with a designated keystore. Follow the ",(0,l.jsx)(n.a,{href:"https://docs.unity3d.com/Manual/android-distribution-google-play.html",children:"Delivering to Google Play guide"}),". It can be a blank project if you have yet configured your Google Login to Unity project. After publishing your game, you are now ready to test."]}),(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["If you have yet not published your game, you will need to add tester accounts to be able to test your game with a Google Account. To do this, follow ",(0,l.jsx)(n.a,{href:"https://support.google.com/googleplay/android-developer/answer/9845334?hl=en#zippy=%2Cinternal-test-manage-up-to-testers",children:"Set up an open, closed, or internal test guide"}),"."]})})]})]})]})}function h(e={}){let{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(c,{...e})}):c(e)}function g(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},786378:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/01_providers_list-1e830d24b42728269e23b5cf13fe3aa8.webp"},168397:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/02_select_google-8eafde6ff86faa96b5cd6e22b3904a74.webp"},8767:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/03_setup_modal_web-dc43a8df55a1f64882dc7d53c275ee24.webp"},169053:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/04_detail_page-959c1ea28862acdbd83fdd9a0b9970e7.webp"},972155:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/05_register_domain-1d23d33b9a73b45919a6d8e2806243a0.webp"},70550:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/06_providers_list_ingame-5ea33885df1fe32197bf2616d24e2de7.webp"},520756:function(e,n,i){i.d(n,{Z:()=>o});
1let o=i.p+"assets/images/07_setup_modal_ingame-d817462cd10b4f0f7b6ee3472abc156d.webp"},684386:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/08_edit_modal-aa56161471855c5968036afb5fd045bd.webp"},701642:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/09_adminlogin-daa0eb902209f01bdf094caf4055ccab.webp"},652211:function(e,n,i){i.d(n,{Z:()=>o});let o=i.p+"assets/images/10_adminportal-c43c9d0342f37f24d71f2c936883befc.webp"},822840:function(e,n,i){i.d(n,{Z:()=>r,a:()=>s});var o=i(202784);let l={},t=o.createContext(l);function s(e){let n=o.useContext(t);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:s(e.components),o.createElement(t.Provider,{value:n},e.children)}},444819:function(e){e.exports=JSON.parse('{"id":"modules/foundations/identity-access/authentication/google-identity","title":"Set up Google as an identity provider","description":"Set up Google as an identity provider for AGS","source":"@site/../../docs/docs-ags/modules/01-foundations/identity-access/03-authentication/11-setup-google-as-an-identity-provider.md","sourceDirName":"modules/01-foundations/identity-access/03-authentication","slug":"/modules/foundations/identity-access/authentication/google-identity","permalink":"/gaming-services/modules/foundations/identity-access/authentication/google-identity","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1790844444000,"sidebarPosition":11,"frontMatter":{"id":"google-identity","title":"Set up Google as an identity provider","description":"Set up Google as an identity provider for AGS","ab_notes":"","ab_teams":"ab_team_access"},"sidebar":"modulesSidebar","previous":{"title":"Set up OIDC as an identity provider","permalink":"/gaming-services/modules/foundations/identity-access/authentication/oidc-identity"},"next":{"title":"Set up Discord as an identity provider","permalink":"/gaming-services/modules/foundations/identity-access/authentication/discord-identity"}}')}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.