メインコンテンツまでスキップ

Epic をアイデンティティプロバイダーとして設定する

Last updated on February 4, 2026

注釈:本資料はAI技術を用いて翻訳されています。

概要

このガイドは、認証されたEpic Gamesデベロッパーが Epic Games アカウントをAccelByte Gaming Services (AGS) に接続するのを支援することを目的としています。ゲームによっては、ここに記載されていないEpic Gamesサービス内の追加機能を設定する必要がある場合があります。Epic Gamesサービスの設定に関する完全な情報については、Epic Gamesの担当者に連絡し、Epic Gamesドキュメントを直接確認することをお勧めします。

important

このガイドは公開用であり、機密性のため限定的な情報が含まれています。まず完全な機密ガイドを参照することをお勧めします。機密ガイドのコピーをリクエストするには、AccelByteテクニカルプロデューサーにお問い合わせください。

目標

  • AccelByte Game SDKを使用してゲームのEpic認証方法を有効にする。
  • AccelByte Player Portalを使用してパブリッシャーウェブサイトのEpic認証方法を有効にする。

前提条件

ウェブログイン統合

  • Epic Developer Account。
  • 認証を設定し、権限を管理するためのAccelByte Admin Portalアカウント。
  • Player PortalとLauncher用のパブリッシャーNamespace。
  • Player Portal。
AGS Shared Cloud

ウェブログイン統合は現在AGS Shared Cloudでは利用できず、AGS Private Cloudでのみサポートされています。

ゲーム内ログイン統合

  • Epic Developer Account。
  • Unreal Engineを使用している場合は、UEバージョン4.27または5.0をインストールする必要があります。
  • Unityを使用している場合は、PlayEveryWare/eos_plugin_for_unityが必要です。
  • 認証を設定し、権限を管理するためのAccelByte Admin Portalアカウント。
  • ゲームNamespace。
  • 最新バージョンのAccelByte Game SDKがインポートされたUnityまたはUnrealゲームプロジェクト。
  • AGS Identity and Access Management (IAM) Clientsに関する知識。

Epic Productの設定

組織の作成

Developer Accountの下に組織を作成し、認証済みドメインを追加する必要があります。

注記

Epicがドメインを認証するには時間がかかります。

Product Brandの設定

製品のBrand Settings、Permissions、Linked Clientsを設定します。How to set up EOS Epic Account Services Guideに従ってください。

注記

Brand Settingsには認証済みドメインが必要です。ドメインがない場合は、ドメインなしで続行できますが、プレイヤーはログイン時に警告メッセージを受け取ります。詳細については、Domain Verificationページを参照してください。

クライアントの作成

製品の下にクライアントを作成します。Adding New Clients Guideに従ってください。

Epic Account Services Applicationの作成

アプリケーションを作成します。Setting Up an EOS Epic Account Services Application Guideに従ってください。

  • Permissionsでは、Basic Profile、Online Presence、Friends Listを有効にする必要があります。
  • Linked Clientsでは、以前に作成したClientを選択します。
注記

Epic Developer Portalでの設定に問題がある場合は、AccelByteのカスタマーサポートに連絡してガイドを入手してください。

Epic Gamesログイン方法の設定

ウェブログイン

  1. AGS Admin portalで、パブリッシャーnamespaceに移動します。

  2. サイドバーメニューで、Game Setup > 3rd Party Configuration > Auth & Account Linkingに移動します。

  3. Login Methodsページで、+ Add Newボタンをクリックします。

    AccelByte Admin Portal Login

  4. ログイン方法オプションのリストから、Epic Gamesを選択します。

    Epic Login

  5. Epic Gamesクライアント認証情報でログイン設定を入力します。Client IDにEpic Client IDを、Client SecretにEpic Client Secretを入力し、Redirect URI<BaseURL>/iam/v3/authenticateを入力します(BaseURLはドメインアドレス、例: https://prod.gamingservices.accelbyte.io)。その後、**Create**ボタンをクリックします。

    Epic Configuration

  6. アクティベートします。

    Epic Activate

試してみる

  1. Player Portalに移動し、Loginボタンをクリックします。

Player Portal

  1. Epic Gamesアイコンをクリックします。見つからない場合は、More login optionsをクリックできます。

Login

  1. Login with Epic Gamesをクリックします。

More Login

  1. Epic Gamesウェブログインページにリダイレクトされ、Epic認証情報を入力して続行できます。以上です。必要な手順が完了しました。

Epic Games login

注記

現在、プレイヤーはEpicアカウントを既存のAccelByteアカウントにリンクするか、新しいアカウントにリンクするよう求められます。AccelByteでは、プレイヤーがヘッドレスアカウントでPlayer Portalに直接ログインできるように、これを設定可能にする取り組みが進行中です。

ゲーム内ログイン

  1. AGS Admin portalで、ゲームnamespaceに移動します。

  2. サイドバーメニューで、Game Setup > 3rd Party Configuration > Auth & Account Linkingに移動します。

  3. Login Methodsページで、+ Add Newボタンをクリックします。

    AccelByte Admin Portal Login

  4. ログイン方法オプションのリストから、Epic Gamesを選択します。

    Epic Login

  5. Epic Gameクライアント認証情報でログイン設定を入力します。Client IDにEpic Client IDを、Client SecretにEpic Client Secretを入力し、Redirect URIhttp://127.0.0.1(localhost)を入力します。その後、Createボタンをクリックします。

    Epic Configuration

  6. アクティベートします。

    Epic Activate

Epic Games用のIAMクライアントの作成

IAMクライアントは、ターゲットプラットフォームでリリースするゲームクライアントの表現です。IAM Clientsの詳細については、Manage access control for applicationsを参照してください。

Unrealゲーム内ログイン統合

AccelByte SDKを使用してゲームサインインを統合し、プレイヤーがEpic認証情報を使用してゲームにログインできるようにすることができます。

Unreal準備と設定

依存関係の追加

まず、<YourProject>.Build.csファイルに公開依存関係モジュールOnlineSubsystemOnlineSubsystemEOSを追加する必要があります。これらは、Unreal Engine内からオンラインサブシステムEOSを使用するためにプロジェクトを統合するために必要なすべての依存関係です。

public ABThirdPartyLogin(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" , "AccelByteUe4Sdk", "Slate", "SlateCore" });

PrivateDependencyModuleNames.AddRange(new string[] { "Json", "OnlineSubsystem", "OnlineSubsystemEOS", "HTTP" });

}

<YourProject>.Target.cs内にOnlineSubsystemEOSを追加します:

public ABThirdPartyLoginTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.AddRange( new string[] { "ABThirdPartyLogin", "OnlineSubsystem", "AccelByteUe4Sdk", "OnlineSubsystemEOS" } );
}

<YourProject>.Target.cs<YourProjectEditor>.Target.csファイル内にOnlineSubsystemSteamを追加します。

public ABThirdPartyLoginEditorTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.AddRange( new string[] { "ABThirdPartyLogin", "OnlineSubsystem", "AccelByteUe4Sdk", "OnlineSubsystemEOS" } );
}

Epic Gamesログイン用のUnreal Engineプロジェクト設定

DefaultEngine.iniファイル内に、Epic設定用のいくつかの変数を追加する必要があります。プロジェクトを開いたときにEpic Online Serviceが自動的に開始されるようにするには、この設定が必要です。

Unreal EngineにOnline Subsystem EOSを使用するように指示するには、次の設定を追加します:

[OnlineSubsystem]
DefaultPlatformService=EOS

Unreal EngineにアプリケーションでEOS Online Subsystemを使用することを伝えたので、次の設定を追加してOnlineSubsystemEOSモジュールを設定する必要があります:

[OnlineSubsystemEOS]
bEnabled=true

Epic Developer Portalから取得した値に基づいて、以下の値を入力できます。

[/Script/OnlineSubsystemEOS.NetDriverEOS]
bIsUsingP2PSockets=true

[/Script/OnlineSubsystemEOS.EOSSettings]
CacheDir=CacheDir
DefaultArtifactName=YOUR Product Name
TickBudgetInMilliseconds=0
bEnableOverlay=True
bEnableSocialOverlay=True
bShouldEnforceBeingLaunchedByEGS=False
TitleStorageReadChunkLength=0
+Artifacts=(ArtifactName="[Your Product Name]",
ClientId="[Your Client ID]",//This ID should start with "xyz" as the first 3 characters
ClientSecret="[Your Client Secret]",//This is the password that is used to verify your Client ID
ProductId="[Your Product ID]",//The EOS SDK uses this ID to identify your product
SandboxId="[Your Sandbox ID]",//The artifact belongs to the sandbox with this ID value.
DeploymentId="[Your Deployment ID]",//Deployment IDs differ for each artifact
EncryptionKey="[Your Encyption Key]")//When you upload data to an EOS service, this 64-byte hexadecimal string is used to encrypt it
bUseEAS=True
bUseEOSConnect=True
bMirrorStatsToEOS=True
bMirrorAchievementsToEOS=True
bUseEOSSessions=True
bMirrorPresenceToEAS=True

AccelByte Gaming Services用のUnreal Engineプロジェクト設定
DefaultEngine.iniにAccelByte認証情報を追加します
[/Script/AccelByteUe4Sdk.AccelByteSettings]
ClientId=<Your IAM_Client_Id>
ClientSecret=<Your IAM_Client_Secret>
Namespace=<Your Namespace>
PublisherNamespace=<Your Publisher Namespace>
RedirectURI=
BaseUrl="https://prod.gamingservices.accelbyte.io"
AppId=133xxx
IamServerUrl="https://prod.gamingservices.accelbyte.io/iam"
PlatformServerUrl="https://prod.gamingservices.accelbyte.io/platform"

Unreal Engineサンプルコード実装

次に、以下のサンプルコードを使用してゲームのEpic認証方法を実装する方法を示します。 IOnlineSubsystemDefaultEngine.iniで定義されたDefaultPlatformService値を読み取ります。IdentityInterfaceは、ユーザーアカウントに関連するこれらのサービスとのやり取りを管理し、ユーザー認証とアクセストークンの取得を可能にします。操作が成功すると、AccelByte SDKのLoginWithOtherPlatform関数が、Identity Interfaceから取得した認証トークンを使用してサードパーティプラットフォームログインを処理します。

注記

スニペットで使用されるAccelByteOnlineSubsystemPtrを取得するには、このガイドに従ってください。

FOnlineAccountCredentials Credentials;
Credentials.Id = FString();
Credentials.Token = FString();
Credentials.Type = FString("accountportal");

UE_LOG(LogTemp, Warning, TEXT("%s"), TEXT("Begin Login"));
const IOnlineSubsystem* OnlineSubsystem = IOnlineSubsystem::Get();
if (OnlineSubsystem == nullptr)//will get active OSS Platform Service
{
FString Message = TEXT("Cannot login with no online subsystem set!");
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message);
return;
}

const IOnlineIdentityPtr OnlineIdentity = OnlineSubsystem->GetIdentityInterface();
if (!OnlineIdentity.IsValid())
{
FString Message = TEXT("Could not retrieve identity interface from native subsystem.");
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message);
return;
}
APlayerController* MyPlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);;

const ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(MyPlayerController->Player);
if (LocalPlayer == nullptr)
{
FString Message = TEXT("Can only login with native platform for local players");
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message);
return;
}

auto ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient(TEXT("YOUR_KEY"));
auto UserApi = ApiClient->GetUserApi().Pin();

const FVoidHandler OnLoginSuccessDelegate = FVoidHandler::CreateLambda([&]() {
FAccountUserData AccountUserData = ApiClient->CredentialsRef->GetAccountUserData();
//if Success will return some user credential
FString AccountUserDataString;
FJsonObjectConverter::UStructToJsonObjectString(AccountUserData, AccountUserDataString);

FString Message = FString::Printf(TEXT("Login to AB Service Success : %s"), *AccountUserDataString);
});
const FCustomErrorHandler OnLoginErrorDelegate = FCustomErrorHandler::CreateLambda([=](int32 ErrorCode, const FString& ErrorMessage, const FJsonObject& ErrorObject) {
FString Message = FString::Printf(TEXT("Error Login to AB Service : %s"), *ErrorMessage);//Failed Login to AB Service
});

const FOnLoginCompleteDelegate NativeLoginComplete = FOnLoginCompleteDelegate::CreateLambda([=]
(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& Error) {
UE_LOG(LogTemp, Warning, TEXT("OnLoginComplete %s : %s"), bWasSuccessful ? TEXT("Success") : TEXT("Fail"), *Error);
FString Message = FString::Printf(TEXT("OnLoginComplete %s : %s"), bWasSuccessful ? TEXT("Success") : TEXT("Fail"), *Error);
OnActionInfoUpdated.Broadcast(Message);

if (bWasSuccessful)
{
const FString PlatformToken = OnlineIdentity->GetAuthToken(LocalPlayer->GetControllerId());
UE_LOG(LogTemp, Warning, TEXT("PlatformToken : %s"), *PlatformToken);
OnActionInfoUpdated.Broadcast(FString::Printf(TEXT("PlatformToken : %s"), *PlatformToken));//Will Obtained Auth Ticket from OnlineIdentity

UserApi->LoginWithOtherPlatform(EAccelBytePlatformType::EpicGames, PlatformToken, OnLoginSuccessDelegate, OnLoginErrorDelegate);
UE_LOG(LogTemp, Warning, TEXT("Request LoginWithOtherPlatform"));
OnActionInfoUpdated.Broadcast(TEXT("Request LoginWithOtherPlatform"));
}//this method will hitting the AccelByte endpoint and will return value after success
});
OnlineIdentity->AddOnLoginCompleteDelegate_Handle(LocalPlayer->GetControllerId(), NativeLoginComplete);
const bool bWaitForDelegate = OnlineIdentity->Login(LocalPlayer->GetControllerId(), Credentials);
if (!bWaitForDelegate)
{
FString Message = TEXT("The online subsystem couldn't login");
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message);
}

FString Message = TEXT("Sending login request to native subsystem!");
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message);
注記

platform_token(Epic Games認証用)はAccess Token/Auth Codeです

このコードをプロジェクトに追加した後、プロジェクトをコンパイル、ビルド、実行します。以上です。

サンプルコードのテスト

以下の画像は、Epicアカウントを使用してテストアプリに正常にログインした様子を示しています。

Epic login with sample code