Username login practical guide
To implement username 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 and account creation are reduced to a single method.
Implementation scope
The work required to implement username login starts with enabling username 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. |
Username 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 username login feature as fine-grained methods. There are separate methods to log in to an existing account, create an account, issue tokens, and activate the session. Even to log in a single user, the app must itself combine the call order and the branching based on whether the account exists.
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/UsernameLogin/ | You copy and use it. It is plain C# code that groups SDK calls by purpose. |
| Usage example | Assets/RecipeExamples/Authentication/UsernameLoginExample.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.
What the app implements
The recipe handles only the login call and the account creation call. The app implements the following items outside the recipe.
- The username and password input screen
- Saving and reusing the
DeviceKey - Guidance on creating a new account and guidance on re-entering input
- The retry policy on failure and recording the results
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 username login.