When I try to login into EOS with connect login and external credentials with a token from PS5 I get success without getting a continuance token even though its a new user who has never logged into EOS before. Subsequently, when I try to create a lobby I get invalid user and user doesn’t have permission to create a lobby. Why am I not getting a continuance token? When I try to do an Auth Login I get a continuance token but I can’t do an auth login for the game since I don’t want the user to create an EOS account on a VR headset. This issue only happens on PS5. The connect login flow works fine on Android headsets where I get a continuance token first time the user logs in.
Here is the Unity Code I am using
public async void StartConnectLoginWithPSNAsync(int controllerIndex, EOSManager.OnConnectLoginCallback onLoginCallback)
{
string psnToken = await GetPSNTokenAsync(controllerIndex);
Debug.Log($“Fetched psnToken {psnToken}”);
if (string.IsNullOrEmpty(psnToken))
{
if (onLoginCallback != null)
{
Epic.OnlineServices.Connect.LoginCallbackInfo callbackInfo = new Epic.OnlineServices.Connect.LoginCallbackInfo();
onLoginCallback(callbackInfo);
}
return;
}
Debug.Log($“Attempting to perform Connect login”);
// Normally this would proceed to do an ExternalAuth, providing the PsnIdToken
// Instead, we’re going to try to do a Connect login directly using this token
// This will circumvent the need for Epic Account Services
EOSManager.Instance.StartConnectLoginWithOptions(ExternalCredentialType.PsnIdToken, psnToken, onloginCallback: (Epic.OnlineServices.Connect.LoginCallbackInfo loginCallbackInfo) =>
{
Debug.Log($“Successful login? {loginCallbackInfo.ResultCode}”);
if (loginCallbackInfo.ResultCode == Result.Success)
{
onLoginCallback(loginCallbackInfo);
}
else if (loginCallbackInfo.ResultCode == Result.InvalidUser)
{
// We need to create this account
EOSManager.Instance.CreateConnectUserWithContinuanceToken(loginCallbackInfo.ContinuanceToken, (Epic.OnlineServices.Connect.CreateUserCallbackInfo createUserCallbackInfo) =>
{
Debug.Log($“{createUserCallbackInfo.ResultCode}”);
if (createUserCallbackInfo.ResultCode == Result.Success)
{
EOSManager.Instance.StartConnectLoginWithOptions(ExternalCredentialType.PsnIdToken, psnToken, onloginCallback: (Epic.OnlineServices.Connect.LoginCallbackInfo callbackAfterCreateUserInfo) =>
{
Debug.Log($“{callbackAfterCreateUserInfo.ResultCode}”);
onLoginCallback(callbackAfterCreateUserInfo);
});
}
else
{
Debug.LogError($“Failed to create user”);
}
});
}
else
{
onLoginCallback(loginCallbackInfo);
}
});
}
private static bool ps5Initialized = false;
public static void EnsurePS5Initialized()
{
if (ps5Initialized)
return;
try
{
UnityEngine.PS5.Utility.onSystemServiceEvent += Utility_onSystemServiceEvent;
UnityEngine.PS5.Utility.onSystemServiceFlagEvent += Utility_onSystemServiceFlagEvent;
UnityEngine.PS5.PS5Input.OnUserServiceEvent += OnUserServiceEvent;
Unity.PSN.PS5.Initialization.InitResult initResult = Unity.PSN.PS5.Main.Initialize();
ps5Initialized = true;
}
catch (Exception exc)
{
Debug.LogError("PSN: Failed to initialize: " + exc.Message);
Debug.LogException(exc);
}
}