Crossplay Integration Kit
Multiplayer

Login in C++

Drive the provider-neutral identity operation API from C++

Login in C++

Add UCIKCore to your module dependencies and get UUCIKIdentitySubsystem from the game instance.

#include "UCIKIdentitySubsystem.h"

FUCIK_LoginMethodFilter Filter;
const TArray<FUCIK_LoginMethodDescriptor> Methods =
	IdentitySubsystem->GetLoginMethods(EBetideProviderPlatform::Win64, Filter);

FUCIK_LoginRequest Request;
Request.LocalUserIndex = 0;
Request.MethodId = TEXT("Betide.EOS.Connect.DeviceId");
Request.AccountPolicy = EUCIK_AccountPolicy::SignInOrCreate;

FUCIK_LoginFieldValue DisplayName;
DisplayName.Type = EUCIK_LoginFieldType::String;
DisplayName.StringValue = TEXT("Player");
Request.Fields.Add(TEXT("DisplayName"), MoveTemp(DisplayName));

const FUCIK_LoginOperation Operation = IdentitySubsystem->Login(
	Request,
	FUCIKLoginUpdateCallback::CreateWeakLambda(this, [this](const FUCIK_LoginUpdate& Update)
	{
		if (Update.Operation.State == EUCIK_LoginOperationState::NeedsChallengeResponse)
		{
			ShowChallenge(Update.Operation, Update.Challenge);
			return;
		}
		if (Update.Operation.State == EUCIK_LoginOperationState::Succeeded)
		{
			UsePlayer(Update.Identity.PrimaryHandle);
		}
	}));

Continue a challenge with the exact operation returned by the update and response fields matching that challenge:

TMap<FName, FUCIK_LoginFieldValue> Responses;
FUCIK_LoginFieldValue Code;
Code.Type = EUCIK_LoginFieldType::String;
Code.StringValue = RuntimeCode;
Responses.Add(TEXT("Code"), MoveTemp(Code));
IdentitySubsystem->ContinueLogin(Operation, Challenge, Responses);

Call CancelLogin(Operation) when the screen closes. Logout accepts explicit scope flags and reports which scopes the authority completed. After success, GetIdentityHandle(ProviderId), GetAuthenticatedProviders(), and HasIdentityProvider(ProviderId) query the cached identity without exposing credentials.

Integration modules own canonical provider-ID constants. A third party adds methods by registering an identity authority or credential source; shared code never switches on a provider name. See Choosing a login method and Adding a provider.

On this page