Set up a dedicated server IAM client - Dedicated servers with AccelByte Multiplayer Servers (AMS) - (Unreal Engine module)
About
IAM clients are used to give permissions to certain resources in AccelByte Gaming Services (AGS). In order for your game's dedicated server to be able to communicate with AccelByte Multiplayer Servers (AMS), you need to set up the correct IAM client permissions.
Create a server IAM client
The server identity and access management (IAM) client is an IAM client that gives permissions for your game server. Sufficient permissions are needed for your game server so it can communicate with AMS.
- AGS Shared Cloud
- AGS Private Cloud
Log in to the AGS Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and App > IAM Clients and click Create IAM Clients.
On the new page, use the configuration below to create a new server IAM client.
- Create Options: the available options to create a new IAM client. Choose Create from Template.
- Select Template: the template to create a new IAM client. Select Dedicated Server. This option gives the necessary permissions for your game server.
- Client Name: the name of the IAM client. Set it to ByteWars-GameServer.
- Client Type: the confidentiality of the IAM client. Since the server IAM client must be secret, set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or click the Generate button to generate a random one. Be sure to copy this.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
http://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
Click Create to create your server IAM client. Once you're done with the creation, the setup is complete.
Log in to the AGS Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and Apps > IAM Clients and click Create New.
On the new window, use the configuration below to create a new server IAM client.
- Client Type: the confidentiality of the IAM client. Since the server IAM client must be secret, set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or just click the Generate Client Secret button to generate a random secret.
- Client Name: the name of the IAM client. Set it to ByteWars-GameServer.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
https://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
Click Create to create your server IAM client and its information will be displayed on the screen.
Go to the Permissions tab and click Add. Add the permissions below one by one.
Resource Permission NAMESPACE:{namespace}:SESSION:GAME Create, Read ADMIN:NAMESPACE:{namespace}:SESSION:GAME Update NAMESPACE:{namespace}:MATCHMAKING:BACKFILL Create, Read, Update, Delete ADMIN:NAMESPACE:{namespace}:STATITEM Create, Read, Update
Now, your server IAM client setup is complete.
Create an AMS CLI IAM client
The AMS command line interface (CLI) IAM client is an IAM client that gives permission for you to upload your server to AMS.
- AGS Shared Cloud
- AGS Private Cloud
Log in to the AGS Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and Apps > IAM Clients and click Create IAM Clients.
On the new page, use the configuration below to create a new AMS CLI IAM client.
- Create Options: the available options to create a new IAM client. Choose Create from Template.
- Select Template: the template to create a new IAM client. Select Dedicated Server Tools. This option gives the necessary permissions to run the AMS CLI.
- Client Name: the name of the IAM client. Set it to ByteWars-AMSCLI.
- Client Type: the confidentiality of the IAM client. Since the AMS CLI IAM client must be secret, set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or click the Generate button to generate a random one. Be sure to copy this.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
http://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
Click Create to create your AMS CLI IAM client and the setup will be complete.
Log in to the AGS Admin Portal and go to your game namespace dashboard.
Go to Game Setup > Games and Apps > IAM Clients and click Create New.
On the new window, use the configuration below to create a new AMS CLI IAM client.
- Client Type: the confidentiality of the IAM client. Since the AMS CLI IAM client must be secret, set it to Confidential.
- Secret: the secret or password for the IAM client. You can use your own secret or just click the Generate Client Secret button to generate a random secret.
- Client Name: the name of the IAM client. Set it to ByteWars-AMSCLI.
- Redirect URI: the URI used to redirect once the IAM client authorization is successful. Set it to
https://127.0.0.1
.
warningThe Secret will not be shown again after you create the IAM client. Be sure to copy and save it before proceeding to the next step.
Click Create to create your AMS CLI IAM client and its information will be displayed on the screen.
Go to the Permissions tab and click Add. Then, add the permission below.
Resource Permission AMS:UPLOAD Create, Update
Now, your AMS CLI IAM client setup is complete.
Configure the Server SDK
Once your server IAM client is configured in the AGS Admin Portal, you'll need to configure the Server SDK in your game project. This section will guide you through configuring the Server SDK so your game server is authorized to communicate with AMS.
Open the
DefaultEngine.ini
file located inConfig
folder of your Byte Wars Unreal project directory.Inside the file, find the
[/Script/AccelByteUe4Sdk.AccelByteServerSettings]
section and replace theClient ID
andClient Secret
with your server IAM client information created from Step 3 of the Create a server IAM client section. Then, flip the boolean forbManualRegisterServer
andbServerUseAMS
totrue
, and bump some log categories verbosity level to verbose under[Core.Log]
. Also, replace other placeholder values based on your game namespace and AGS environment.- AGS Shared Cloud
- AGS Private Cloud
[/Script/AccelByteUe4Sdk.AccelByteServerSettings]
ClientId=<server_iam_client_id>
ClientSecret=<server_iam_client_secret>
Namespace=<game_namespace_id>
PublisherNamespace=
RedirectURI="http://127.0.0.1"
BaseUrl="https://<game_namespace_id>.prod.gamingservices.accelbyte.io"
[OnlineSubsystemAccelByte]
bManualRegisterServer=True
[/Script/AccelByteUe4Sdk.AccelByteSettings]
bServerUseAMS=True
; ByteWars tutorial module specific
[/ByteWars/TutorialModule.DSEssentials]
bServerUseAMS=true
[Core.Log]
LogAccelByte=Log
LogAccelByteOSS=Verbose
LogAccelByteAMS=Verbose
LogAccelByteDSHub=Verboseinfo- ClientId is randomly generated and used to uniquely identify your server IAM client.
- ClientSecret is the secret (password) for your server IAM client.
- Namespace is the namespace ID of your game namespace.
- RedirectURI is the URI that will redirect your game server after the server authorization is completed. The default value is
http://127.0.0.1
. - BaseUrl is the base URL made out of your game namespace ID combined with your AGS Admin Portal environment.
- bManualRegisterServer is a flag for the dedicated server that allows the server to manually tell AMS that it is ready to welcome players. This is to avoid an issue where the server is still in the initialization state (loading assets, fetching some cloud save configuration, etc.) but players are trying to connect to the server.
- bServerUseAMS is a flag for the game client to grab AMS available locations using the AGS Game SDK.
[/Script/AccelByteUe4Sdk.AccelByteServerSettings]
ClientId=<server_iam_client_id>
ClientSecret=<server_iam_client_secret>
Namespace=<game_namespace_id>
PublisherNamespace=accelbyte
RedirectURI="http://127.0.0.1"
BaseUrl="https://<studio_name>.accelbyte.io"
[OnlineSubsystemAccelByte]
bManualRegisterServer=True
[/Script/AccelByteUe4Sdk.AccelByteSettings]
bServerUseAMS=True
; ByteWars tutorial module specific
[/ByteWars/TutorialModule.DSEssentials]
bServerUseAMS=true
[Core.Log]
LogAccelByte=Log
LogAccelByteOSS=Verbose
LogAccelByteAMS=Verbose
LogAccelByteDSHub=Verboseinfo- ClientId is randomly generated and used to uniquely identify your server IAM client.
- ClientSecret is the secret (password) for your server IAM client.
- Namespace is the namespace ID of your game namespace.
- PublisherNamespace is the publisher ID of your publisher namespace. The default value is
accelbyte
. - RedirectURI is the URI that will redirect your game server after the server authorization is completed. The default value is
http://127.0.0.1
. - BaseUrl is the base URL of your AGS Admin Portal environment.
- bManualRegisterServer is a flag for the dedicated server that allows the server to manually tell AMS that it is ready to welcome players. This is to avoid an issue where the server is still in the initialization state (loading assets, fetching some cloud save configuration, etc.) but players are trying to connect to the server.
- bServerUseAMS is a flag for the game client to grab AMS available locations using AGS SDK.
tipTo find your game namespace ID, go to your Admin Portal and navigate to the Namespace page where your game namespaces are listed. Then, locate your game namespace under the GAMES section and click on the gear icon. On the new page, locate the Namespace ID property and there you can find your game namespace ID value.
Similarly, to find your publisher namespace ID, go to your Admin Portal and navigate to the Namespace page where your game namespaces are listed. Then, locate your publisher namespace under the PUBLISHER section and click on the gear icon. On the new page, locate the Namespace ID property and there you can find your publisher namespace ID value.
Save the
DefaultEngine.ini
file and rebuild your Byte Wars project.