Add identity and authentication to your game - AWS GameKit

Add identity and authentication to your game

The following describes the basic steps that are required to add an identity and authentication game feature to your game. If you don't yet have the AWS GameKit plugin for your game engine, see Install the AWS GameKit plugin.

Unreal Engine

Step 1. Configure the identity and authentication game feature for your game project.

  1. In the Unreal Editor toolbar, open Edit, Project Settings and go to the AwsGameKit plugin section. Select the environment you want to work in and enter valid AWS credentials as needed. For more details, see Set up the AWS GameKit plugin for your game.

  2. Expand the Identity and authentication section. Specify the following configuration options:

    • Login mechanisms. Choose which login mechanisms that you want to offer to your players. Email/Password is selected by default, and at least one option is required. If you choose to enable Facebook, you’ll be prompted to enter the Facebook app ID for your game. Learn more about getting a Facebook app ID on the Facebook Developers portal.

    Your settings updates are automatically cached locally during the current session. If you deploy an AWS solution for your identity and authentication backend services, it will reflect these settings.

    
                AWS GameKitplugin project settings in the Unreal Editor

Step 2. Deploy AWS resources for your identity and authentication backend.

  1. In the AWS GameKit project settings under Identity and Authentication, choose the AWS resource action Create. This action prompts AWS GameKit to deploy a complete AWS solution to run the backend services for this game feature. When deploying, AWS GameKit first generates a template for the AWS solution, including your custom configuration settings, and then connects to AWS to create the solution's AWS resources as defined in the template. The AWS resources are deployed to the AWS region as selected for the active environment.

  2. Deploying resources for the identity and authentication backend typically takes 5 minutes to complete. You can track the progress of your deployment status:

    • In the Unreal Editor, open the output log window to monitor status messages, events and errors throughout the deployment.

    • In the AWS Management console, open the AWS CloudFormation service. In the Stacks view you can watch as the Identity stack for your game project is deployed.

    • In the Unreal Editor, AWS GameKit project settings, open the custom dashboard for this game feature. These dashboards are generated at the beginning of the deployment process.

    When deployment is complete, your game backend for the identity and authentication game feature is in place. You can make calls to it using the AWS GameKit API.

    Note

    NOTE: From this point on, you might begin incurring costs for this game feature. If you're still in the AWS Free Tier window, you will only incur costs if you exceed free tier limits.

Step 3. Add sign-in workflow components to your game.

Create UI elements and add code for the player identity workflows as needed for your game. See the plugin's Identity examples for illustration. Workflows might include:

  • Register a new player with email

    • Register()

    • ConfirmRegistration()

    • ResendConfirmationCode()

  • Sign in a player with an existing email account

    • Login()

    • GetUser() and GetResponseBody()

    • Logout()

  • Sign in a new or existing player with Facebook

    • GetFederatedLoginUrl()

    • PollAndRetrieveFederatedTokensAsync() or PollAndRetrieveFederatedTokensBlueprintAsync()

    • GetFederatedAccessToken()

    • Logout()

  • Recover a password for an existing account

    • ForgotPassword()

    • ConfirmForgotPassword()