What is the minimum required login flow to be able to unlock EOS Achievements?

Hi, I’m using the latest version of eos_plugin_for_unity (4.0.2) in Unity 2022.3.60f1 on Windows and I’m struggling to get a login setup that allows me to unlock EOS Achievements.

I’m currently doing the following (simplified code below).

From what I’ve seen in the samples this should be correct, right? Do I need to login with the connect interface or can I do it some way with the auth interface only? Also, is it required to handle auth expiration?

private void BeginLogin() {
  var args = EOSManager.EOSSingleton.GetCommandLineArgsFromEpicLauncher();
  var credentialType = LoginCredentialType.ExchangeCode;
  if (string.IsNullOrEmpty(args.epicUserID) || string.IsNullOrEmpty(args.authPassword)) {
    credentialType = EOS_AUTH.LoginCredentialType.AccountPortal;
  }
  EOSManager.Instance.StartLoginWithLoginTypeAndToken(credentialType, args.epicUserID, args.authPassword, StartLoginCallback);
}

private void StartLoginCallback(LoginCallbackInfo info) {
  if (info.ResultCode == Result.Success) {
    EOSManager.Instance.StartConnectLoginWithEpicAccount(info.LocalUserId, ConnectCallback);
  }
}

private void ConnectCallback(LoginCallbackInfo info) {
  if (connectLoginResult.ResultCode != Result.Success) {
    EOSManager.Instance.CreateConnectUserWithContinuanceToken(info.ContinuanceToken, CreateConnectUserCallback);
  }
}

private void CreateConnectUserCallback(CreateUserCallbackInfo info) {
  if (info.ResultCode != Result.Success) {
    var localUserId = EOSManager.Instance.GetLocalUserId();
    EOSManager.Instance.StartConnectLoginWithEpicAccount(localUserId, NewUserConnectCallback);
  }
}

private void NewUserConnectCallback(LoginCallbackInfo info) {
  if (info.ResultCode == Result.Success) {
    _loggedIn = true;
  }
}

As Epic Online Services is identity provider agnostic, you must perform this two-step login operation to authenticate the Epic account (EOS_Auth_Login) and then log in to the EOS backend (EOS_Connect_Login).

This is the same two-step process you would need when running on another platform: first, acquire the platform access token, then use this to log into EOS.

When launching from the Epic Games Launcher, the Exchange Code is available as a launch argument to make the EOS_Auth_Login seamless and silent to the player.

The code you provided above looks correct. Could you please ensure that the SDK logging is enabled, and share the errors that you’re running into?

Please feel free to create a private discussion to share these to avoid the need for redacting any private information.