Do we really need to implement the login? #497
-
Hello. This may seem a weird and/or basic question but, please, bear with me! I've gone through a lot of different documentation, including this part where it says that the correct way to log into the EGS is using the exchange code method. Then, my first question would be: isn't the EOS Manager component already doing it? As I found some discussions related to that where other fellow devs tried to implement the login themselves, I assumed the answer to that previous question was "no". I have read some people that is implementing it so a login window pops up so the user enters their credentials, but isn't the user already logged into the Epic Games Launcher? Why should we need them to log in again? When starting, for example, Deliver Us Mars I got no login window pop up and I can see the achievements and stuff working, so I'm probably missing something... I'm sorry if this is explained somewhere, but I have not been able to find a proper answer to that question. Anyway, I tried to implement the log in as suggested (the recommended way), but I'm getting an InvalidRequest error (this component is attached to the same GameObject prefab with the EOS Manager component, and it's instantiated at game startup). public class EpicSessionController: MonoBehaviour
{
private IEnumerator Start()
{
yield return new WaitForSeconds(2);
EOSManager.EOSSingleton.EpicLauncherArgs argsEpic = EOSManager.Instance.GetCommandLineArgsFromEpicLauncher();
EOSManager.Instance.StartLoginWithLoginTypeAndToken(
LoginCredentialType.ExchangeCode,
null, // Intended for UserID, but is unused for Exchange Code login
argsEpic.authPassword, // The exchange code itself, passed as login token
StartLoginWithLoginTypeAndTokenCallback);
}
private void StartLoginWithLoginTypeAndTokenCallback(LoginCallbackInfo callbackInfo)
{
if (callbackInfo.ResultCode != Epic.OnlineServices.Result.Success)
{
CreateAndConnectWithContinuanceToken(callbackInfo);
}
}
private void CreateAndConnectWithContinuanceToken(LoginCallbackInfo callbackInfo)
{
EOSManager.Instance.CreateConnectUserWithContinuanceToken(callbackInfo.ContinuanceToken, (Epic.OnlineServices.Connect.CreateUserCallbackInfo createUserCallbackInfo) => {
// Creating new connect user
EOSManager.Instance.StartConnectLoginWithEpicAccount(callbackInfo.LocalUserId, (Epic.OnlineServices.Connect.LoginCallbackInfo retryConnectLoginCallbackInfo) => {});
});
}
} I don't know why I'm getting that InvalidRequest (as callbackInfo.ResultCode) error so I would appreciate if you could help me guess what I am doing wrong so I can do it correctly? By the way, I'm testing it on the Epic Games Launcher with my game uploaded in the Dev sandbox. In case you need any further info, please let me know :) Thank you for your time. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @dulceangustia - Sorry that we have been rather unresponsive here in the discussions tab. For starters - are you still experiencing uncertainty about this and/or still having trouble implementing it? Without a little more information, it's hard to know what might be going on, and since it's been two weeks I thought I'd just start by checking in on where you're at with it now. |
Beta Was this translation helpful? Give feedback.
-
Hi @paulhazen. Thanks for your answer! Once I configured the linked clients in the "Epic Account Services" on the game's backend it started being able to log in. Sorry I missed that, I'm struggling a bit having the game properly configured and couldn't figure it out before. Now I'm trying to unlock achievements, but I'll ask for help in a separate discussion, I hope it's ok! In summary, the log in code I posted in the OP is working for me now since the only thing I was missing was configuring the linked clients on the development portal. |
Beta Was this translation helpful? Give feedback.
Hi @paulhazen. Thanks for your answer!
Once I configured the linked clients in the "Epic Account Services" on the game's backend it started being able to log in. Sorry I missed that, I'm struggling a bit having the game properly configured and couldn't figure it out before.
Now I'm trying to unlock achievements, but I'll ask for help in a separate discussion, I hope it's ok!
In summary, the log in code I posted in the OP is working for me now since the only thing I was missing was configuring the linked clients on the development portal.