User icon with a lock symbol, representing secure user access or authentication. Work with the identity and authentication examples - 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. Work with the identity and authentication examples

The AWS GameKit plugin includes example assets for the identity and authentication game feature.

Unreal Engine

The AWS GameKit plugin for Unreal Engine provides examples with C++ code, blueprints, and UI components. You can access the example files in the Unreal Editor content browser.

Work with the C++ examples

In the Unreal Editor content browser, find the example asset at the following location:

AwsGameKit C++ Classes > AwsGameKitEditor > Public > Identity > AwsGameKitIdentityExamples

This asset is a .cpp file. You can also find this file in the AWS GameKit plugin files, located at ...\AwsGameKit\Source\AwsGameKitEditor\Private\Identity\AwsGameKitIdentityExamples.cpp.

This example file contains sample code that illustrates how to call each of the identity and authentication API actions. This file contains the basic set of runnable code and includes detailed comments.

You can work with this example in two ways: view the code in your IDE, or experiment with the API calls in Unreal Editor.

To view or edit the example code:
  • Double-click the AwsGameKitIdentityExamples asset to open the file in your IDE. You do not need to enter AWS credentials or deploy AWS resources before accessing this file, however none of the API calls can work without deployed resources.

    The example code includes a standard check to verify that AWS resources are deployed.

    Note that, as a first step, the example code creates an instance of the UAwsGameKitIdentityCallableWrapper and initializes it. This must be done before making any API calls.

To experiment with the example in Unreal Editor:

You must have AWS resources deployed for identity and authentication and you must submit your valid AWS credentials in the AWS GameKit plugin project settings (see Set up the AWS GameKit plugin for your game).

  1. Drag the AwsGameKitIdentityExamples asset into level in the view port. It doesn't matter what level you add the asset to, this is just a mechanism that enables you to work with the asset settings.

  2. In the Editor's Details pane, all of the identity and authentication API calls are available with API request and response values.

  3. To make an API call, enter some input values and click the "Call" button. The response is displayed in the Return Value field.

  4. Try running the following call sequences to simulate standard identity scenarios:

    • Register a new player with email: Register Player, Confirm Email

    • Sign in a player with an existing account: Login, Get User, Logout

    • Sign in a new or existing player with Facebook: Open Facebook Login, Get User, Logout

    • Recover a password for an existing account: Forgot Password, Confirm Forgot Password

Work with the Blueprint and UI examples

In the Unreal Editor Content Browser, find the example assets at the following location:

AwsGameKit Content > Identity >

There are two example assets:

  • BP_AwsGameKitIdentityExamples

    This asset is a basic blueprint that illustrates how you might add sign-in functionality to your game code.

    Actions:

    • To open the blueprint, double-click the asset.

  • BP_AwsGameKitIdentityExamplesUI

    This asset includes a detailed blueprint for common sign-in workflow scenarios and sample UI objects.

    Actions:

    • To open the blueprint, double-click the asset.

    To run the example, click Play.