Skip to main content

User Accounts

Last updated on

Overview

User Accounts allow people to access your platform. This includes not only your players, but also anyone at your organization who has access to the Admin Portal.

There are two types of users: Admin and players. Admin users are those who are allowed to access the Admin Portal, while players can only access your game directly. Player accounts can be managed by Admin in the Admin Portal.

Logging in as an Admin

When you create an account in the Admin Portal, you’ll automatically be granted the game admin role. This role contains permissions that grant you access to specific resources within our services so you can manage everything related to your games and players. The game admin role cannot be modified, but you can view information about the role under the Roles tab of your user account.

account-management

Managing Accounts in the Admin Portal

Search for a User

  1. In the game studio namespace of the Admin Portal, expand the Users Management section and click Users.

    account-management

  2. Select the search filter from the dropdown menu in the Search User panel that corresponds to the user’s account information that you have on hand.

    account-management

    Type the user’s credentials into the text box and press Enter to search. The search results will appear.

    account-management

    NOTE

    If you choose to search for a player using 3rd-party platform credentials, two new dropdown menus will appear. In the first dropdown menu, select the 3rd-party platform your player comes from, such as Steam or Epic Games. In the second dropdown menu, select either Platform Display Name or Platform User ID, depending on which credentials you have available.

Invite an Admin User

As a game admin user, you can quickly invite your colleagues or community managers from your game to the Admin Portal. The invited user will have the same game admin role and game studio namespace as where you are working when you enter their email address to invite them as per the below instructions.

  1. In the Admin Portal, expand the Users Management section, select Users, and click the Invite Admin button.

    account-management

  2. The Invite Admin dialog box will appear. Input the email address of the person you want to invite. To invite multiple people at once, press Enter, Tab, or Comma to separate email addresses.

    account-management

  1. Click Invite to send the invitation link.

  2. The invited user will receive an invitation link. In the invitation email, click Complete My Account to complete registration.

IMPORTANT

The invitation link will expire after one week. If the invited user doesn’t complete the registration within that time period, you must send them a new invitation.

NOTE

If your game studio doesn’t have any game title yet, the first user will be asked to create a game title as soon as they have successfully logged in, prior to loading the Admin Portal.

account-management

Change a User’s Email Address

You can follow the procedure below to change any user’s email address, including your own:

  1. In the Admin Portal, open the Users menu and type the Email or Display Name of the desired user in the search bar, and then click Enter to search.

    TIP

    Our user search allows fuzzy search, meaning that you can find the player you’re looking for by typing just the first few characters of the player’s credentials rather than their full name or email address.

  2. The results of your search will appear. Find the account you’re looking for and click View in the Action column of the account listing to open it.

    account-management

  3. The User Overview window will appear, giving you a quick look at the user’s account data. Click Change under the user’s email address.

    account-management

  4. To change a user’s email address, you’ll first need to verify your identity. In the Change User’s Email confirmation box that appears, click the Send Verification Code button to send a verification code to the email address with which you’re logged into the Admin Portal.

    account-management

  5. The Change User’s Email confirmation box will change to show two fields. Enter the verification code that was sent to your email address in the Verify your identity field, and enter a new email address for the user in the Set new email address for the user field. Once completed, click Confirm.

    account-management

  6. You’ll be redirected back to the User Overview page. The user will be sent a verification message to their old email address. After the user confirms the update, their email address will be changed automatically.

View a User’s Event Log

The User Event Log shows you the history of any changes or actions made by a user, such as when a user logged into the portal or downloaded their personal data.

  1. In the Admin Portal, open the Users menu and type the Email or Display Name of the desired user in the search bar, and then click Enter to search.

    TIP

    Our user search allows fuzzy search, meaning that you can find the player you’re looking for by typing just the first few characters of the player’s credentials rather than their full name or email address.

  2. The results of your search will appear. Browse the list to find the account you’re looking for and click View in the Action column of the account listing.

    account-management

  3. The User Overview window will appear with a quick overview of the user’s account data. Select the Logs tab.

  4. On the Logs tab, you will see a list of user logs, the namespace they belong to, and the time each log was created. You can sort the logs by creation time or namespace to help you find a particular log.

    account-management

  5. To open a log, click View in that log’s Action column.

  6. The Event Log Details window appears. Here you can see the log’s contents.

    account-management

View a User’s Edit History

The account history feature allows you to see changes made to account data by users. The information available includes changes made to a user’s Display Name, Email Address, Password, or Date of Birth.

  1. In the Admin Portal, open the Users menu and type the Email or Display Name of the desired user in the search bar and then click Enter to search.

    TIP

    Our user search allows fuzzy search, meaning that you can find the player you’re looking for by typing just the first few characters of the player’s credentials rather than their full name or email address.

  2. The results of your search will appear. Browse the list to find the account you’re looking for and click View in the Action column of the account listing.

    account-management

  3. The User Overview window will appear with a quick overview of the user’s account data. Click View account history on the right-hand side.

    account-management

  4. Input the Start and End Date of the time period for which you want to retrieve the history. In the example below, we have input 2020-07-27 to 2020-08-04 to see the changes the user made to their Display Name within that time period. You can also view the edit history for other fields such as Email Address, Password, or Date of Birth.

    account-management

Implementing Accounts Using the SDK

In-Game Player Registration

This function allows your players to register for an account in your game.

const FString OriginalEmail = TEXT("originalEmail@example.com");
const FString Username = TEXT("JohnDoe");
const FString Password = TEXT("password");
const FString DisplayName = TEXT("testName");
const FString Country = TEXT("US");
const FString DateOfBirth = TEXT("2000-12-20");
bool bUserAccountCreated = false;

FRegistry::User.Registerv2(OriginalEmail, Username, Password, DisplayName, Country, DateOfBirth,
THandler<FUserData>::CreateLambda([&bUserAccountCreated](const FUserData& Result)
{
UE_LOG(LogAccelByteUserTest, Display, TEXT("Success."));
bUserAccountCreated = true;
}),
FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogAccelByteUserTest, Error, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage)
}));
IMPORTANT

Please make sure that the inputted fields follow these rules:

Username:

  • Minimum length of 3 and maximum length of 48.
  • Only alphanumeric characters, underscores, and dashes are allowed.
  • Spaces are not allowed.
  • Must start and end with an alphanumeric character.

Password:

  • Minimum length of 8 and maximum length 32 characters.
  • Must contain at least 3 of the following 4 types of characters: uppercase letters, lowercase letters, numbers, special characters.
  • No more than 2 equal characters in a row.

Display name:

  • Minimum length of 8 and maximum length of 32.
  • Only uppercase and lowercase letters, spaces, and special characters are allowed.
  • Must start and end with an alphanumeric character.

Email address:

  • Minimum length of 3 and maximum length of 256.
  • Only alphanumeric characters, '@', '.', '_', '-', '+', '&', and '*' are allowed.
  • Must start and end with an alphanumeric character.

Player Verifies Registration

This function allows a player to verify their account registration, which they must do before they can log into their account.

const FString VerificationCode = TEXT("verification-code-from-email");

FRegistry::User.Verify(VerificationCode, FVoidHandler::CreateLambda([&bVerifyUserSuccessful]()
{
UE_LOG(LogAccelByteUserTest, Display, TEXT("Success."));
}),
FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogAccelByteUserTest, Error, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage)
}));

Player Upgrades a Headless Account

This function upgrades a headless account by linking the headless account with the email address and password.

const FString OriginalEmail = TEXT("originalEmail@example.com");
const FString Password = TEXT("Password1");

FAccountUserData userData;
FRegistry::User.Upgrade(OriginalEmail, Password,
THandler<FAccountUserData>::CreateLambda([&](const FAccountUserData& Result)
{
userData = Result;
UE_LOG(LogAccelByteUserTest, Display, TEXT("Success."));
}),
FErrorHandler::CreateLambda([&](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogAccelByteUserTest, Error, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage);
}));

//log out
FRegistry::User.ForgetAllCredentials();

Player Login with Username and Password Without 2FA Enabled

This function shows how players can log into your game using a verified account.

const FString OriginalEmail = TEXT("originalEmail@example.com");
const FString Password = TEXT("Password1");
bool bUserLoggedIn = false;

FRegistry::User.LoginWithUsername(OriginalEmail, Password,
FVoidHandler::CreateLambda([&bUserLoggedIn]()
{
UE_LOG(LogAccelByteUserTest, Display, TEXT("Success."));
bUserLoggedIn = true;
}),
FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Error, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage)
}));

Get Account Data for the Currently Signed-in User

Getting user data retrieves all of the personal data for the player that’s logged in.

bool bGetDataSuccessful = false;
FAccountUserData GetDataResult;
FRegistry::User.GetData(
THandler<FAccountUserData>::CreateLambda([&](const FAccountUserData& Result)
{
UE_LOG(LogAccelByteUserTest, Log, TEXT("Success"));
bGetDataSuccessful = true;
GetDataResult = Result;
}),
FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogAccelByteUserTest, Fatal, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage)
}));

Get User Data in Bulk

You can retrieve public player data by submitting user IDs for the desired players using the following function. Public player data includes the AvatarUrl of a player’s avatar, their DisplayName, and their UserId.

TArray<FString> UserIds = {"userId1", "userId2", "userId3"};
bool bBulkUserInfoSuccess = false;
FListBulkUserInfo BulkUserInfoResult;

FRegistry::User.BulkGetUserInfo(UserIds, THandler<FListBulkUserInfo>::CreateLambda([&bBulkUserInfoSuccess, &BulkUserInfoResult](const FListBulkUserInfo& Result)
{
/* do something when succeed */
BulkUserInfoResult = Result;
bBulkUserInfoSuccess = true;
}),FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
/* do something when failed */
UE_LOG(LogAccelByteUserTest, Error, TEXT("Error. Code: %d, Reason: %s"), ErrorCode, *ErrorMessage)
}));