User icon with a lock symbol, representing secure user access or authentication.Add identity and authentication to your project - AWS GameKit

You are currently viewing content for use with Unreal Engine software. See all AWS GameKit documentation

User icon with a lock symbol, representing secure user access or authentication.Add identity and authentication to your project

Summary

Learn how to build a complete cloud-based identity and authentication system and integrate it into a Unreal Engine project. This topic guides developers through building backend services and then using the AWS GameKit API to connect frontend code to the backend on AWS.

When you're ready to build out the identity and authentication feature for your game, follow these basic steps. If you don't yet have AWS GameKit installed for your project, see Install the AWS GameKit plugin with Unreal Engine and Set up the AWS GameKit plugin for your game.

Step 1. Configure the identity and authentication game feature.

  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. The default selection is Email/Password, and you must have at least one option selected. If you choose to support player login with Facebook, enter the Facebook app ID and secret key for your game. Learn more about getting a Facebook app ID on the Facebook Developers portal.

    All changes you make to feature settings are cached locally during the current session.

    AWS GameKitplugin project settings in the Unreal Editor

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

  1. While still in the AWS GameKit settings for Identity and Authentication, scroll down to the deployment controls. Choose the AWS resource action Create. This action prompts AWS GameKit to deploy the complete AWS solution to run the backend services for this game feature. When deploying, AWS GameKit connects to AWS to create all the AWS resources for the solution, using the configuration template maintained for the active environment.

  2. Deploying resources for identity and authentication typically takes 5 minutes to complete. During this time, the feature's deployment status reads Deploying resources. 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.

    When deployment is complete, the feature's deployment status reads Deployed. Your game backend for identity and authentication 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 player identity workflows to your game.

Create UI elements and add code for the following workflows. See the plugin's Identity examples for illustration and experiment with API calls using the C++ code examples.

Identity and authentication workflows 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()

  • Reset the password for an existing account

    • ForgotPassword()

    • ConfirmForgotPassword()