Prepare resources needed for login processing

Prepare resources for issuing anonymous accounts and logging in

To start using the GS2-Account service, you need to add a namespace.

Namespace (namespace) is a mechanism to allow the same service to be used for different purposes within a single project. Within different namespaces, the same service is treated as a completely different data space.

img_14.png

Now, using the sample template, add game-0001 to the GS2-Account namespace name and issue the encryption key that will be used to authenticate the account and make it possible to create a new account.

In GS2-Deploy’s Create New Stack, create a stack by specifying the following template as the template data

GS2TemplateFormatVersion: "2019-05-01"
Description: GS2-Account initialize template Version 2010-06-26

Globals:
  Alias:
    AccountNamespaceName: game-0001
    KeyNamespaceAccountAuthentication: account-encryption-key-namespace
    KeyAccountAuthentication: account-encryption-key

Resources:
  KeyNamespaceAccountAuthentication:
    Type: GS2::Key::Namespace
    Properties:
      Name: ${KeyNamespaceAccountAuthentication}

  KeyAccountAuthentication:
    Type: GS2::Key::Key
    Properties:
      NamespaceName: ${KeyNamespaceAccountAuthentication}
      Name: ${KeyAccountAuthentication}
    DependsOn:
      - KeyNamespaceAccountAuthentication

  AccountNamespace:
    Type: GS2::Account::Namespace
    Properties:
      Name: ${AccountNamespaceName}

Outputs:
  AccountNamespaceName: !GetAttr AccountNamespace.Item.Name
  KeyAccountAuthenticationKeyId: !GetAttr KeyAccountAuthentication.Item.KeyId

Download sample template