Skip to content

Unity

This guide provides instructions for setting up authentication in the Hive SDK for Unity.

Enter the key values for each IdP in hive_config.xml

Enter the key values obtained from each IdP console in hive_config.xml. For more details, please refer to Authentication Prerequisites.

Unity inspector settings

Hive SDK Unity allows you to configure hive_config.xml using the Unity Inspector. Select Hive > Hive Config (Edit Config) and set the OS and Hive AppID in the Unity Hive Config Editor screen. After that, in the Auth menu, enter the AppID, web application ClientID, etc., issued by each IdP provider console according to the IdP you want to use, such as Facebook, Google SignIn, Google Play Games, QQ.


Android



Note

For detailed information about the values to be entered, please refer to the documentation of each IdP provider console.

EDM4U plugin settings

  1. Click on the Hive > Hive Dependencies (ExternalDependency) menu.

When the settings window appears, select the feature you want to use.

![](../../img/Hive_Dependencies_Editor_25.0.0.png){width="450px"}

Feature addition

Select only the authentication features you want to use in the Hive Module Settings.

  • Device Management: Device Management Service
  • reCAPTCHA: Use Google Recaptcha for guest login
  • Real Name Verification: A feature that requires users accessing from China to undergo real-name verification for games that have received a Chinese license
  • Google InAppUpdate: Google In-App Update feature (Android)
Note

For detailed guidance on each function, please refer to here.

Add IdP

In the Auth Settings, select only the IdP you want to use. For example, to use the Google IdP, select Google SignIn in the Auth Settings. To use the GooglePlayGames IdP, select Google Play Games. Another example is to use Facebook login; select Facebook in the Auth Settings.

Note

To apply the VK library in Unity Android builds, a minSdkVersion of 21 or higher and a targetSdkVersion of 32 or higher are required. Please add VK settings according to the following.
To apply the Line library in Unity Android builds, a minSdkVersion of 24 or higher is required.

Warning

If you use Facebook IdP, due to the automatic configuration within the Hive SDK for building Facebook sharing activation, you cannot install market-specific Android builds (e.g., Google Play Store, One Store) simultaneously.

If you are not using Facebook sharing activation, please refer to the troubleshooting guide to remove the FacebookContentProvider permission declaration.

Unity login simulator (optional)

Using the Unity login simulator, you can temporarily issue an AuthV4 guest account available in the Hive sandbox server environment.
The Unity login simulator feature can be checked in the Hive > LoginSimulator > Open AuthV4 Setting menu as shown below.



To use this feature, the following conditions must be met.

  1. hive_config.xml Configuration Complete
  2. In the Unity-Build settings menu, write appId in the current platform (iOS, Android, Windows, Mac) hive_config.xml (auto-filled)
  3. Enter the Hive certification key


    After that, each time you press the Create button, a new guest account will be issued, and the account information will be saved as a file.

You can obtain temporary guest account information through the following example code. The did and other additional information, excluding playerId and playerToken, are temporarily generated or specified values from the client.

// Hive Sandbox 서버에서 발급된 playerId
long playerId = AuthV4LoginData.playerId;
// Hive Sandbox 서버에서 발급된 playerToken
string playerToken = AuthV4LoginData.playerToken;
// 클라이언트에서 임시로 설정된 playerName
string playerName = AuthV4LoginData.playerName;
// 클라이언트에서 임시로 설정된 playerImageUrl
string plalyerImageUrl = AuthV4LoginData.playerImageUrl;
// 클라이언트에서 임시로 설정된 did (1000000000이상 2000000000미만의 임의 값)
string did = AuthV4LoginData.did;
Warning

This account is a guest account specifically issued for testing conveniently on the Unity Editor screen using the Hive Sandbox. Care must be taken to ensure that it does not mix with information from accounts used in commercial services.