Guest login practical guide
To implement guest login in your app, you must combine Hive Console settings, Hive Axyl SDK calls, recipe code calls, and app code. With the recipe code, the Hive Axyl SDK calls needed for login are reduced to a single method.
Implementation scope
The work required to implement guest login starts with enabling guest login in the Hive Console and ends with displaying the screen that matches the login result.
The work in each step falls into one of the following four categories.
| Category | Owner | Description |
|---|---|---|
| Hive Console | App operator | Settings you configure in the Hive Console. |
| Hive Axyl SDK | App developer | Hive Axyl SDK methods the app calls. |
| Recipe code | App developer | Recipe methods the app calls. |
| App code | App developer | Parts the app implements directly without going through Hive Axyl. |
Guest login involves no store plugin calls and no Hive Axyl Server API calls. For the meaning of parameters and response fields, see the detailed procedure linked in each step.
Recipe
The Hive Axyl SDK provides the guest login feature as fine-grained methods. There are separate methods to create an account, log in with an existing account, issue tokens, and activate the session. Even to log in a single user, the app must combine the call order and the handling of intermediate failures itself.
A recipe is source code that completes that combination in advance. Instead of installing it as a package, you copy it into your project.
| Category | Location | Characteristics |
|---|---|---|
| Hive Axyl SDK | Unity packages com.com2usplatform.hiveaxyl.* | You install and use it. It provides authentication features as fine-grained methods. |
| Recipe | Assets/Recipes/GuestLogin/ | You copy and use it. It is plain C# code that groups SDK calls by purpose. |
| Usage example | Assets/RecipeExamples/Authentication/GuestLoginExample.cs | Code to read for reference. Its comments explain the recipe call order and what the app must implement for each result. |
Recipes are code you copy and use
Recipes are copied into your app and become your app's code. You can use them as is or modify them to fit your app's policies.
Apps that apply additional security to guest account creation cannot use this recipe as is, because GuestLoginRecipe does not accept the pre-approval value GrantKey. In this case, call the Hive Axyl SDK methods directly to implement guest account creation and guest login.
What the app implements
The recipe handles only the login calls. The app implements the following items outside the recipe.
- The login screen and the screen transition after login
- Saving, reusing, and deleting the
DeviceKeyand guest credentials - The retry policy on failure and the guidance messages for users
Common prerequisites
Before you start implementing, prepare the following items.
| Item to prepare | Required | Category | Where to check |
|---|---|---|---|
| Create a project | Required | Hive Console | Create a project |
| Create an App ID | Required | Hive Console | Create an App ID |
| Connect the SDK to your Unity project | Required | Hive Axyl SDK | Connect the SDK to your Unity project |
The App ID is a value you enter when you initialize the SDK, so you must create it first. You must connect the SDK before you can install the authentication module in the following steps.
Next steps
When you finish the prerequisites, start Implement guest login.